Using MSTest how can I verify the exact error message coming from a test method? I know [ExpectedException(typeof(ApplicationException), error msg)] doesn\'t co
Fluent Assertions (NuGet) has a very "language natural" syntax for defining expectations in unit tests:
objectundertest.Invoking(o => o.MethodUnderTest()).Should().Throw()
.WithMessage("the expected error message");
There are multiple variations for checking the error message with any algorithm (Where(e => ...) as well as checking into inner exceptions and their messages.