public void AddWorld()
        {
            // Arrange.
            IWorldManager worldManager = new WorldManager();
            IWorld        world        = new MockWorld(1, null, null);

            // Act.
            worldManager.AddWorld(world);

            // Assert.
            Assert.Pass();
        }
        public void GetWorld()
        {
            // Arrange.
            IWorldManager worldManager = new WorldManager();
            IWorld        world        = new MockWorld(1, null, null);

            // Act.
            worldManager.AddWorld(world);

            // Assert.
            Assert.IsTrue(worldManager.GetWorld(1) == world);
        }
        public void RunWorld()
        {
            // Arrange.
            IWorldManager worldManager = new WorldManager();
            AbstractWorld world        = new MockWorld(1, null, null);

            worldManager.AddWorld(world);

            // Act.
            worldManager.RunWorld(1);

            // Assert.
            Assert.IsTrue(world.State == WorldState.Running);
        }
        public void StopWorld_Reset()
        {
            // Arrange.
            IWorldManager worldManager = new WorldManager();
            AbstractWorld world        = new MockWorld(1, null, null);

            worldManager.AddWorld(world);
            worldManager.RunWorld(1);

            // Act.
            worldManager.StopWorld(1, true);

            // Assert.
            Assert.IsTrue(world.State == WorldState.None);
        }
        public void GetWorldsInState()
        {
            // Arrange.
            IWorldManager worldManager = new WorldManager();
            IWorld        world1       = new MockWorld(1, null, null);
            IWorld        world2       = new MockWorld(2, null, null);
            IWorld        world3       = new MockWorld(3, null, null);

            // Act.
            worldManager.AddWorld(world1);
            worldManager.RunWorld(1);
            worldManager.AddWorld(world2);
            worldManager.RunWorld(2);
            worldManager.AddWorld(world3);

            IReadOnlyList <IWorld> worlds = worldManager.GetWorldsInState(WorldState.Running);

            // Assert.
            Assert.IsTrue(worlds.Count == 2 && worlds.Contains(world1) && worlds.Contains(world2));
        }