Skip to content

Instantly share code, notes, and snippets.

@istepaniuk
Last active December 10, 2015 01:58
Show Gist options
  • Save istepaniuk/4364199 to your computer and use it in GitHub Desktop.
Save istepaniuk/4364199 to your computer and use it in GitHub Desktop.
Exception cheking using FluentAssertions
[TestMethod()]
public void ThrowsAnExceptionIfItIsNotAFruit()
{
var service = new FruitColorService();
Action action = () => service.GetColorOf(new Tomato());
action.ShouldThrow<InvalidFruitException>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment