예제 #1
0
        public void ExecuteKillCommand()
        {
            SetupTests();
            IGameCommand north = new North();

            north.ExecuteCommand(new [] { " North " }, _player);
            north.ExecuteCommand(new[] { " North " }, _player);
            north.ExecuteCommand(new[] { " North " }, _player);


            IGameCommand sut = new Kill();

            string[] args   = { "kill", "rat" };
            bool     result = sut.ExecuteCommand(args, _player);

            Assert.IsTrue(result);
            Assert.IsNotNull(_player.NonPlayerCharacterFighting);
            Assert.IsTrue(_player.CurrentHitPoints <= 0 || _player.NonPlayerCharacterFighting.CurrentHitPoints <= 0);
        }