Beispiel #1
0
        public void ShouldRemoveGameObjectAt_When_Not_Pickable()
        {
            //Arrange
            GameArena          arena = new GameArena(0);
            List <IGameObject> gameObjectsExpected = new List <IGameObject>();
            GameObject         obj     = new GameObject(new Coordinates(0, 1));
            Pickable           powerup = new BombFireDecrease(new GameObject(new Coordinates(2, 2)));

            // Act
            gameObjectsExpected.Add(powerup);
            arena.gameObjects.Add(obj);
            arena.gameObjects.Add(powerup);

            arena.RemoveGameObjectAt(obj.GetCords().X, obj.GetCords().Y);
            //Assert
            CollectionAssert.AreNotEqual(arena.gameObjects, gameObjectsExpected);
        }
Beispiel #2
0
        public void ShouldRemoveGameObjectAt_When_Pickable()
        {
            //Arrange
            GameArena          arena = new GameArena(0);
            List <IGameObject> gameObjectsExpected = new List <IGameObject>();
            Explosive          bomb    = new Explosive(1, 1);
            Pickable           powerup = new BombFireDecrease(new GameObject(new Coordinates(2, 2)));

            // Act
            gameObjectsExpected.Add(bomb);

            arena.gameObjects.Add(bomb);
            arena.gameObjects.Add(powerup);

            arena.RemoveGameObjectAt(powerup.GetCords().X, powerup.GetCords().Y);
            //Assert
            CollectionAssert.AreEqual(arena.gameObjects, gameObjectsExpected);
        }