Ejemplo n.º 1
0
        public int GetClearsUntilAvailable(IWorldMissionProgress i_missionProgress, int i_optionIndex)
        {
            int requiredClearCount = GetRequiredMapClearCount(i_optionIndex);
            int clearedAreas       = i_missionProgress.GetCompletedMissionCount();

            return(Math.Max(0, requiredClearCount - clearedAreas));
        }
Ejemplo n.º 2
0
        private IWorldMissionProgress GetBadMissionProgress()
        {
            IWorldMissionProgress missionProgress = Substitute.For <IWorldMissionProgress>();

            missionProgress.GetCompletedMissionCount().Returns(0);

            return(missionProgress);
        }
Ejemplo n.º 3
0
        public void TestClearsUntilAvailableCountIsExpected_GivenIndexAndProgress(int i_index, int i_progress, int i_expected)
        {
            TravelOption          optionUnderTest = GetBasicTravelOptionForTest();
            IWorldMissionProgress missionProgress = Substitute.For <IWorldMissionProgress>();

            missionProgress.GetCompletedMissionCount().Returns(i_progress);

            int clearsUntilAvailable = optionUnderTest.GetClearsUntilAvailable(missionProgress, i_index);

            Assert.AreEqual(i_expected, clearsUntilAvailable);
        }