Exemplo n.º 1
0
        public void PerformTheMission_MissionIsNull_ReturnFalse()
        {
            _warrior.Setup(w => w.ChooseTheBestMission(
                               It.IsAny <List <MissionInfo> >(),
                               It.IsAny <UserInfo>()))
            .Returns(value: null);

            var result = _missionBoard.PerformTheMission();

            Assert.That(result, Is.EqualTo(false));
        }
Exemplo n.º 2
0
        public void Play()
        {
            StartGame();

            while (IsStillAlive())
            {
                if (FeelExhausted())
                {
                    InfoHelper.DisplayRecoverHP(_store.RecoverHP());
                }

                // make your level is as high as possible
                _store.LevelUp();
                InfoHelper.DisplayLevelUp();

                _missionBoard.RefreshMissionBoard();
                InfoHelper.DisplayMissionBoardIsRefreshed();

                // if pick nothing, The Missions Board will be refreshed.
                if (!_missionBoard.PickMissions())
                {
                    continue;
                }

                // when The Mission Board is empty, buy items and refresh the board.
                while (!_missionBoard.MissionBoardIsEmpty())
                {
                    // when the mission is failed, buy items and refresh the board.
                    if (!_missionBoard.PerformTheMission())
                    {
                        IsFailed();
                        break;
                    }

                    IsSucceeded();
                }
            }

            EndGame();
        }