예제 #1
0
        public void OfTypeTest()
        {
            AssertPasses("mystring", AnInstance.OfType <String>());
            AssertPasses(new MySubType(), AnInstance.OfType <MySubType>());
            AssertPasses(new MySubType(), AnInstance.OfType <MyType>());
            AssertPasses(new MySubType(), AnInstance.OfType <Object>());

            AssertFails(1, AnInstance.OfType <String>());
            AssertFails(new Object(), AnInstance.OfType <MyType>());
        }