Esempio n. 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"
            })));
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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();
            }
        }
Esempio n. 7
0
        public void Matches_should_detect_nominal()
        {
            var subj = new OrMatcher <string>(Matchers.BeEmpty(), Matchers.HaveCount(0));

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