예제 #1
0
        public void TestSequenceEqualCustomMessage()
        {
            var expected  = new int[] { 0 };
            var actual    = new int[] { 1 };
            var verifier  = new NUnitVerifier();
            var exception = Assert.Throws <AssertionException>(() => verifier.SequenceEqual(expected, actual, message: "Custom message"));

            verifier.EqualOrDiff($"Custom message", exception.Message);
        }
예제 #2
0
        public void TestSequenceEqualCustomMessageWithContext()
        {
            var expected  = new int[] { 0 };
            var actual    = new int[] { 1 };
            var verifier  = new NUnitVerifier().PushContext("Known Context");
            var exception = Assert.Throws <AssertionException>(() => verifier.SequenceEqual(expected, actual, message: "Custom message"));

            verifier.EqualOrDiff($"Context: Known Context{Environment.NewLine}Custom message", exception.Message);
        }
예제 #3
0
        public void TestSequenceEqualMessage()
        {
            var expected  = new int[] { 0 };
            var actual    = new int[] { 1 };
            var verifier  = new NUnitVerifier();
            var exception = Assert.Throws <AssertionException>(() => verifier.SequenceEqual(expected, actual));

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