public void TestTrueCustomMessage() { var verifier = new NUnitVerifier(); var exception = Assert.Throws <AssertionException>(() => verifier.True(false, "Custom message")); verifier.EqualOrDiff($" Custom message{Environment.NewLine} Expected: True{Environment.NewLine} But was: False{Environment.NewLine}", exception.Message); }
public void TestTrueMessageWithContext() { var verifier = new NUnitVerifier().PushContext("Known Context"); var exception = Assert.Throws <AssertionException>(() => verifier.True(false)); verifier.EqualOrDiff($" Context: Known Context{Environment.NewLine}{Environment.NewLine} Expected: True{Environment.NewLine} But was: False{Environment.NewLine}", exception.Message); }