.Net NUnit assert throws

NUnit test that an exception is thrown with the appropriate message:

...
Assert.That(
                () => command.Execute(null),
                Throws.TypeOf<Exception>()
                    .With.Message.EqualTo(expectedMessage));
...

Leave a Reply

Your email address will not be published. Required fields are marked *