public void TestFailCustomMessage() { var verifier = new NUnitVerifier(); var exception = Assert.Throws <AssertionException>(() => verifier.Fail("Custom message")); verifier.EqualOrDiff($"Custom message", exception.Message); }
public void TestFailCustomMessageWithContext() { var verifier = new NUnitVerifier().PushContext("Known Context"); var exception = Assert.Throws <AssertionException>(() => verifier.Fail("Custom message")); verifier.EqualOrDiff($"Context: Known Context{Environment.NewLine}Custom message", exception.Message); }
public void TestFailMessage() { var verifier = new NUnitVerifier(); var exception = Assert.Throws <AssertionException>(() => verifier.Fail()); verifier.EqualOrDiff(string.Empty, exception.Message); }