Пример #1
0
        public void CanPerformPlayerAction_ShouldReturnTrue_GivenPlayerInGameAndStayAction()
        {
            var map          = CreateMap(100, 100);
            var sut          = new MapUtils(map);
            var playerInGame = map.CharacterInfos.First().Id;

            var result = sut.CanPlayerPerformAction(playerInGame, Action.Stay);

            Assert.True(result);
        }
Пример #2
0
        public void CanPerformPlayerAction_ShouldReturnFalse_GivenPlayerNotInGame()
        {
            var map          = CreateMap(100, 100);
            var sut          = new MapUtils(map);
            var randomAction = _fixture.Create <Action>();

            var result = sut.CanPlayerPerformAction("player-not-in-game", randomAction);

            Assert.False(result);
        }
Пример #3
0
        public void CanPerformPlayerAction_ShouldReturnFalse_GivenDownMoveWhenPlayerIsAtTheBottom()
        {
            var map          = CreateMap(100, 100);
            var sut          = new MapUtils(map);
            var playerInGame = map.CharacterInfos.First();

            playerInGame.Position = 10000;

            var result = sut.CanPlayerPerformAction(playerInGame.Id, Action.Down);

            Assert.False(result);
        }
Пример #4
0
        public void CanPerformPlayerAction_ShouldReturnFalse_GivenExplodeActionAndPlayerNotCarryingPowerUp()
        {
            var map          = CreateMap(100, 100);
            var sut          = new MapUtils(map);
            var playerInGame = map.CharacterInfos.First();

            playerInGame.CarryingPowerUp = false;

            var result = sut.CanPlayerPerformAction(playerInGame.Id, Action.Explode);

            Assert.False(result);
        }
Пример #5
0
        public void CanPerformPlayerAction_ShouldReturnTrue_GivenValidUpMove()
        {
            var map          = CreateMap(100, 100);
            var playerInGame = map.CharacterInfos.First();

            playerInGame.Position = 101;
            var sut = new MapUtils(map);

            var result = sut.CanPlayerPerformAction(playerInGame.Id, Action.Up);

            Assert.True(result);
        }