예제 #1
0
        public void EntityQueryFilterCannotContainExcludeComponentType_Any_Throws()
        {
            var query = new EntityQueryDesc
            {
                Any = new ComponentType[] { typeof(EcsTestData), ComponentType.Exclude <EcsTestData2>() },
            };

            Assert.Throws <ArgumentException>(() =>
            {
                query.Validate();
            });
        }
예제 #2
0
        public void EntityQueryFilter_IdenticalIds_InSameFilter_Throws()
        {
            var query = new EntityQueryDesc
            {
                All = new ComponentType[] { typeof(EcsTestData), typeof(EcsTestData) }
            };

            Assert.Throws <EntityQueryDescValidationException>(() =>
            {
                query.Validate();
            });
        }
예제 #3
0
        public void EntityQueryFilter_SeparatedIds()
        {
            var query = new EntityQueryDesc
            {
                All  = new ComponentType[] { typeof(EcsTestData), typeof(EcsTestData2) },
                None = new ComponentType[] { typeof(EcsTestData3), typeof(EcsTestData4) },
                Any  = new ComponentType[] { typeof(EcsTestData5) },
            };

            Assert.DoesNotThrow(() =>
            {
                query.Validate();
            });
        }
예제 #4
0
        public void EntityQueryFilter_MultipleIdenticalIds_Throws()
        {
            var query = new EntityQueryDesc
            {
                All  = new ComponentType[] { typeof(EcsTestData), typeof(EcsTestData2) },
                None = new ComponentType[] { typeof(EcsTestData3), typeof(EcsTestData) },
                Any  = new ComponentType[] { typeof(EcsTestData), typeof(EcsTestData4) },
            };

            Assert.Throws <EntityQueryDescValidationException>(() =>
            {
                query.Validate();
            });
        }