Exemplo n.º 1
0
        public void TestMethodsCalled_NoEntity()
        {
            UpdatableSystem system = new UpdatableSystem();
            IWorld world = CreateWorld(system);

            world.UpdateAll(0);

            Assert.AreEqual(0, system.EntityAddedCalled);
            Assert.AreEqual(0, system.EntityRemovedCalled);
            Assert.AreEqual(1, system.BeforeUpdateCalled);
            Assert.AreEqual(1, system.AfterUpdateCalled);
            Assert.AreEqual(0, system.UpdateEntityCalled);
        }
Exemplo n.º 2
0
        public void TestMethodsCalled_FiveUpdates_TwoEntities()
        {
            UpdatableSystem system = new UpdatableSystem();
            IWorld world = CreateWorld(system);
            Entity entity = world.CreateEntity();
            Entity entity2 = world.CreateEntity();

            world.UpdateAll(0);
            world.UpdateAll(0);
            world.UpdateAll(0);
            world.UpdateAll(0);
            world.UpdateAll(0);

            Assert.AreEqual(2, system.EntityAddedCalled);
            Assert.AreEqual(0, system.EntityRemovedCalled);
            Assert.AreEqual(5, system.BeforeUpdateCalled);
            Assert.AreEqual(5, system.AfterUpdateCalled);
            Assert.AreEqual(10, system.UpdateEntityCalled);
        }