コード例 #1
0
        public void MatchesValueOfAssignableType()
        {
            Matcher m = new TypeMatcher(typeof (B));

            Assert.IsTrue(m.Matches(new B()), "should match B");
            Assert.IsTrue(m.Matches(new D()), "should match D");
        }
コード例 #2
0
        public void DoesNotMatchValueOfNonAssignableType()
        {
            Matcher m = new TypeMatcher(typeof (D));

            Assert.IsFalse(m.Matches(new B()), "should not match B");
            Assert.IsFalse(m.Matches(123), "should not match B");
            Assert.IsFalse(m.Matches("hello, world"), "should not match B");
        }