示例#1
0
        public void Matches_should_detect_contra_nominal()
        {
            var subj = Matchers.Or(Matchers.BeEmpty(), Matchers.HaveCount(0));

            Assert.False(subj.Matches(TestActual.Value(new List <string> {
                "A", "B"
            })));
        }
示例#2
0
        public void Matches_should_detect_error()
        {
            var subj = new NotMatcher <int>(
                Matchers.Equal(20)
                );
            var val = subj.Matches(TestActual.Value(20));

            Assert.False(val);
        }
示例#3
0
        public void Matches_should_apply_nominal()
        {
            var subj = new NotMatcher <int>(
                Matchers.Equal(20)
                );
            var val = subj.Matches(TestActual.Value(10));

            Assert.True(val);
        }
示例#4
0
        public void Matches_should_detect_empty_nominal_func()
        {
            var subj = new SatisfyAnyMatcher <int[]>(
                Matchers.BeEmpty(),
                Matchers.HaveCount(10)
                );
            var val = subj.Matches(TestActual.Value(new int[] { 2 }));

            Assert.False(val);
        }
示例#5
0
        public void Matches_should_apply_Any_nominal()
        {
            var subj = new SatisfyAnyMatcher <int[]>(
                Matchers.BeEmpty(),
                Matchers.HaveCount(10)
                );
            var val = subj.Matches(TestActual.Value(new int[0]));

            Assert.True(val);
        }
示例#6
0
        public void Matches_should_fail_on_null_thunk()
        {
            var subj = new InstanceOfMatcher(typeof(string));

            try {
                subj.Matches(TestActual.Value((string)null));

                Assert.Fail("Expected to fail with AssertException -- can't match null");
            } catch (AssertVerificationException) {
                Assert.Pass();
            }
        }
示例#7
0
        public void Matches_should_detect_nominal()
        {
            var subj = new OrMatcher <string>(Matchers.BeEmpty(), Matchers.HaveCount(0));

            Assert.True(subj.Matches(TestActual.Value("")));
        }