コード例 #1
0
        public static void GenerateMessage_should_generate_the_correct_message_when_the_lambda_parameter_returns_false()
        {
            var sut = new StringShouldBeAssertion(
                "expected", "actual", (e, a) => false,
                new MockCodeTextGetter(),
                new MockDiffHighlighter());
            var expected = @"
            SomeCodeText
            should be
            ""expected""
            but was
            ""actual""
            difference
            expected and actual are different!
            Additional Info:
            custom message";

            var actual = sut.GenerateMessage("custom message");

            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
 public static void IsSatisfied_should_return_true_when_the_lambda_parameter_returns_true()
 {
     var sut = new StringShouldBeAssertion(
         "", "", (e, a) => true, null, null);
     Assert.That(sut.IsSatisfied());
 }