コード例 #1
0
        public void TestFalseCustomMessageWithContext()
        {
            var verifier  = new NUnitVerifier().PushContext("Known Context");
            var exception = Assert.Throws <AssertionException>(() => verifier.False(true, "Custom message"));

            verifier.EqualOrDiff($"  Context: Known Context{Environment.NewLine}Custom message{Environment.NewLine}  Expected: False{Environment.NewLine}  But was:  True{Environment.NewLine}", exception.Message);
        }
コード例 #2
0
        public void TestFalseMessage()
        {
            var verifier  = new NUnitVerifier();
            var exception = Assert.Throws <AssertionException>(() => verifier.False(true));

            verifier.EqualOrDiff($"  Expected: False{Environment.NewLine}  But was:  True{Environment.NewLine}", exception.Message);
        }