Example #1
0
        public void ComponentPoolCreatesNewComponentWhenEmpty()
        {
            var type      = typeof(NameAgeComponent);
            var component = _defaultEntity.CreateComponent(1, type);

            Assert.AreEqual(type, component.GetType());

            var nameAgeComponent = ((NameAgeComponent)component);

            Assert.IsNull(nameAgeComponent.name);
            Assert.AreEqual(0, nameAgeComponent.age);
        }