示例#1
0
        public void MatchesValuesWithType()
        {
            var x = new AnyMatcher(typeof(int));

            Assert.True(x.Matches(5));
            Assert.False(x.Matches("foo"));
        }
示例#2
0
        public void NonNullableNeverMatchesNull()
        {
            var x = new AnyMatcher(typeof(int));
            var y = AnyMatcher <int> .Default;

            Assert.False(x.Matches(null));
            Assert.False(y.Matches(null));
        }
示例#3
0
        public void NullableIntMatchesNull()
        {
            var x = new AnyMatcher(typeof(int?));

            Assert.True(x.Matches(null));
        }
示例#4
0
        public void MatchesDerivedType()
        {
            var x = new AnyMatcher(typeof(Base));

            Assert.True(x.Matches(new Derived()));
        }