コード例 #1
0
            public void Returns_the_desription_when_the_matcher_supports_describing_non_matches()
            {
                var matcher = new MatcherSupportingDescribe();
                var subject = new ArgumentSpecification(typeof(object), matcher);

                var result = subject.DescribeNonMatch(new object());

                Assert.That(result, Is.EqualTo(MatcherSupportingDescribe.Description));
            }
コード例 #2
0
            public void Returns_arg_incompatible_without_calling_describable_matcher_when_specification_is_for_an_incompatible_type()
            {
                var matcher = new MatcherSupportingDescribe();
                var subject = new ArgumentSpecification(typeof(int), matcher);

                var result = subject.DescribeNonMatch("not an int");

                var expectedResult = string.Format("Expected an argument compatible with type {0}. Actual type was {1}.", typeof(int), typeof(string));

                Assert.That(result, Is.EqualTo(expectedResult));
            }