Exemplo n.º 1
0
        public void MatchesValuesWithType()
        {
            var x = new AnyMatcher(typeof(int));

            Assert.True(x.Matches(5));
            Assert.False(x.Matches("foo"));
        }
Exemplo n.º 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));
        }
Exemplo n.º 3
0
        public void NullableIntMatchesNull()
        {
            var x = new AnyMatcher(typeof(int?));

            Assert.True(x.Matches(null));
        }
Exemplo n.º 4
0
        public void MatchesDerivedType()
        {
            var x = new AnyMatcher(typeof(Base));

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