Ejemplo n.º 1
0
        public void TestFailCustomMessage()
        {
            var verifier  = new NUnitVerifier();
            var exception = Assert.Throws <AssertionException>(() => verifier.Fail("Custom message"));

            verifier.EqualOrDiff($"Custom message", exception.Message);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        public void TestFailMessage()
        {
            var verifier  = new NUnitVerifier();
            var exception = Assert.Throws <AssertionException>(() => verifier.Fail());

            verifier.EqualOrDiff(string.Empty, exception.Message);
        }