Ejemplo n.º 1
0
        public void TestStandardConstraintPass7()
        {
            var constraint = new TypeConstraintStandard(typeof(Component), TypeSettings.Class | TypeSettings.Interface, true, false);
            var collection = TypeUtilities.GetCollection(constraint);

            Assert.IsFalse(collection.Contains(typeof(ClassBase)));
            Assert.IsTrue(collection.Contains(typeof(Collider)));
        }
Ejemplo n.º 2
0
        public void TestStandardConstraintPass4()
        {
            var constraint = new TypeConstraintStandard(typeof(Interface1), TypeSettings.Interface, true, true);
            var collection = TypeUtilities.GetCollection(constraint);

            Assert.IsFalse(collection.Contains(typeof(ClassBase)));
            Assert.IsFalse(collection.Contains(typeof(ClassWithInterface1)));
#pragma warning disable CS0612
            Assert.IsFalse(collection.Contains(typeof(ClassWithInterface2)));
#pragma warning restore CS0612
            Assert.IsFalse(collection.Contains(typeof(ClassWithInterface3)));
            Assert.IsTrue(collection.Contains(typeof(Interface2)));
            Assert.IsTrue(collection.Contains(typeof(Interface3)));
        }