예제 #1
0
        protected override IEnumerator RunAllTests()
        {
            bool completedMission = ShouldMarkMissionsComplete();

            yield return(IntegrationTestUtils.SetPlayerCurrencyAndWait(0));

            yield return(SetMissionDataOnServer());

            yield return(SetMissionProgressOnServer(completedMission));

            yield return(ClearUnitModifierData());

            yield return(SetPlayerDataOnServer());

            yield return(InitiateMissionComplete());

            if (IsTestExpectedToFail())
            {
                FailTestIfClientInSync(GetType().ToString());
            }
            else
            {
                FailTestIfClientOutOfSync(GetType().ToString());
            }

            yield return(RunOtherFailureChecks());
        }
 private void SetProgressData()
 {
     IntegrationTestUtils.SetReadOnlyData(IntegrationTestUtils.TRAINER_DATA_KEY, TRAINER_SAVE_DATA);
     IntegrationTestUtils.SetReadOnlyData(IntegrationTestUtils.SAVE_KEY_BUILDINGS, BUILDING_SAVE_DATA);
     IntegrationTestUtils.SetReadOnlyData(IntegrationTestUtils.SAVE_KEY_UNITS, UNIT_SAVE_DATA);
     IntegrationTestUtils.SetReadOnlyData(BackendConstants.WORLD_PROGRESS, WORLD_PROGRESS_SAVE_DATA);
 }
예제 #3
0
        protected IEnumerator SetDataForTestPrep()
        {
            IntegrationTestUtils.SetReadOnlyData(IntegrationTestUtils.SAVE_KEY_UNITS, SAVE_VALUE_UNITS);
            IntegrationTestUtils.SetReadOnlyData(SAVE_KEY_BUILDINGS, SAVE_VALUE_BUILDINGS);

            yield return(mBackend.WaitUntilNotBusy());
        }
예제 #4
0
        private IEnumerator SetSomePlayerSaveData()
        {
            yield return(IntegrationTestUtils.SetPlayerCurrencyAndWait(1000));

            IntegrationTestUtils.SetReadOnlyData(IntegrationTestUtils.SAVE_KEY_GUILDS, "{\"GUILD_1\":{\"Level\":1,\"Points\":0}}");

            yield return(mBackend.WaitUntilNotBusy());
        }
예제 #5
0
        protected IEnumerator SetStartingSaveLevelAndData(int i_level)
        {
            mCurrentTestData.SaveValue = DrsStringUtils.Replace(mCurrentTestData.SaveValue, "LEVEL", i_level);

            IntegrationTestUtils.SetReadOnlyData(mCurrentTestData.SaveKey, mCurrentTestData.SaveValue);

            yield return(mBackend.WaitUntilNotBusy());
        }
        private IEnumerator SetPlayerDataOnServer()
        {
            IntegrationTestUtils.CreateAndSetRandomMapSaveData(TEST_WORLD, GetMapLevel(), TEST_SIZE, null);
            yield return(mBackend.WaitUntilNotBusy());

            // do this AFTER setting map data because that test method RESETS progress
            SetProgressData();
            yield return(mBackend.WaitUntilNotBusy());
        }
예제 #7
0
        protected override IEnumerator SetMissionDataOnServer()
        {
            MapData map  = CreateMapData();
            string  data = JsonConvert.SerializeObject(map);

            IntegrationTestUtils.SetReadOnlyData("Map_" + MISSION_WORLD, data);

            yield return(mBackend.WaitUntilNotBusy());
        }
예제 #8
0
        private void SetGameMetricData()
        {
            GameMetrics metrics = new GameMetrics();

            metrics.Metrics = new Dictionary <string, int>();
            metrics.Metrics.Add(GameMetricsList.TOTAL_MISSIONS_DONE, GetTotalMissionsCompleted());

            IntegrationTestUtils.SetReadOnlyData(IntegrationTestUtils.SAVE_KEY_METRICS, JsonConvert.SerializeObject(metrics));
        }
        protected override IEnumerator RunAllTests()
        {
            SetBuildingProgressData();
            yield return(mBackend.WaitUntilNotBusy());

            yield return(IntegrationTestUtils.SetInternalData(BackendConstants.LOGGED_IN_TIME, LOGGED_IN_TIME.ToString()));

            yield return(RunTrainingTests());
        }
        private IEnumerator RunTest()
        {
            yield return(SetDataForTestPrep());

            yield return(IntegrationTestUtils.SetInternalData(BackendConstants.LOGGED_IN_TIME, LOGGED_IN_TIME.ToString()));

            yield return(IntegrationTestUtils.TrainUnit(UNIT_BEING_COUNTED, 1));

            yield return(FailTestIfLastCountTimeNotUpdated());
        }
        protected void SetProgressData(int i_level, int i_trainers)
        {
            string data = PROGRESS_DATA;

            data = DrsStringUtils.Replace(data, "LEVEL", i_level);
            data = DrsStringUtils.Replace(data, "TRAINERS", i_trainers);
            data = DrsStringUtils.Replace(data, "TIME", CURRENT_CLIENT_TIMESTAMP);

            IntegrationTestUtils.SetReadOnlyData(PROGRESS_KEY, data);
        }
예제 #12
0
        private IEnumerator CannotAffordNewTrainer()
        {
            IntegrationTestUtils.SetReadOnlyData(SAVE_KEY, DrsStringUtils.Replace(SAVE_VALUE, "NUM", 1));
            IntegrationTestUtils.SetPlayerCurrency(0);

            yield return(mBackend.WaitUntilNotBusy());

            yield return(MakePurchaseCall());

            FailTestIfClientInSync("CannotAffordNewTrainer");
        }
예제 #13
0
        protected override IEnumerator RunTest()
        {
            IntegrationTestUtils.SetReadOnlyData(mCurrentTestData.SaveKey, DrsStringUtils.Replace(mCurrentTestData.SaveValue, "NUM", 1));
            IntegrationTestUtils.SetPlayerCurrency(0);

            yield return(mBackend.WaitUntilNotBusy());

            yield return(MakeUpgradeCall());

            FailTestIfClientInSync("Test_CannotAffordUpgrade");
        }
예제 #14
0
        private IEnumerator SetPlayerDataOnServer()
        {
            IntegrationTestUtils.CreateAndSetRandomMapSaveData(TEST_WORLD, TEST_LEVEL, IntegrationTestUtils.DEFAULT_MAP_SIZE, (result) => {
                mMapData = result;
            });
            yield return(mBackend.WaitUntilNotBusy());

            // do this AFTER setting map data because that test method RESETS progress
            SetMissionProgressSaveData();
            yield return(mBackend.WaitUntilNotBusy());
        }
        protected override IEnumerator RunTest()
        {
            IntegrationTestUtils.SetReadOnlyData(mCurrentTestData.SaveKey, DrsStringUtils.Replace(mCurrentTestData.SaveValue, "NUM", 1));
            IntegrationTestUtils.SetPlayerCurrency(mCurrentTestData.Cost);

            yield return(mBackend.WaitUntilNotBusy());

            yield return(MakeUpgradeCall());

            FailTestIfCurrencyDoesNotEqual(0);
            yield return(FailTestIfNotProgressLevel <ProgressBase>(mCurrentTestData.TestClass, mCurrentTestData.TestID, 2));
        }
        private IEnumerator RunTest()
        {
            yield return(SetDataForTestPrep());

            yield return(UpdateUnitCounts(TIME_ELAPSED));

            yield return(IntegrationTestUtils.UpgradeTarget_NoRules(UNIT_BEING_COUNTED, GenericDataLoader.UNITS));

            yield return(FailTestIfUnitCountDoesNotEqual(EXPECTED_COUNT));

            yield return(FailTestIfLastCountTimeNotUpdated());
        }
예제 #17
0
        private IEnumerator CanAffordNewTrainer()
        {
            IntegrationTestUtils.SetReadOnlyData(SAVE_KEY, DrsStringUtils.Replace(SAVE_VALUE, "NUM", 1));
            IntegrationTestUtils.SetPlayerCurrency(COST);

            yield return(mBackend.WaitUntilNotBusy());

            yield return(MakePurchaseCall());

            FailTestIfCurrencyDoesNotEqual(0);
            FailTestIfReturnedCallDoesNotEqual(CloudTestMethods.getTrainerCount.ToString(), 2);

            yield return(mBackend.WaitUntilNotBusy());
        }
        private IEnumerator SetInitialProgress()
        {
            RepeatableQuestProgress questProgress = new RepeatableQuestProgress();

            questProgress.CompletedCount     = 0;
            questProgress.CurrentlyAvailable = false;
            questProgress.World = BackendConstants.WORLD_BASE;

            Dictionary <string, RepeatableQuestProgress> allQuestProgress = new Dictionary <string, RepeatableQuestProgress>();

            allQuestProgress[BackendConstants.WORLD_BASE] = questProgress;
            string data = JsonConvert.SerializeObject(allQuestProgress);

            IntegrationTestUtils.SetReadOnlyData(BackendConstants.REPEATABLE_QUEST_PROGRESS, data);

            yield return(mBackend.WaitUntilNotBusy());
        }
        protected override IEnumerator SetMissionDataOnServer()
        {
            RepeatableQuestProgress questProgress = new RepeatableQuestProgress();

            questProgress.CompletedCount     = 0;
            questProgress.CurrentlyAvailable = ShouldQuestBeAvailable();
            questProgress.World   = MISSION_WORLD;
            questProgress.Mission = CreateMissionData();

            Dictionary <string, RepeatableQuestProgress> allQuestProgress = new Dictionary <string, RepeatableQuestProgress>();

            allQuestProgress[MISSION_WORLD] = questProgress;
            string data = JsonConvert.SerializeObject(allQuestProgress);

            IntegrationTestUtils.SetReadOnlyData(BackendConstants.REPEATABLE_QUEST_PROGRESS, data);

            yield return(mBackend.WaitUntilNotBusy());
        }
예제 #20
0
        protected IEnumerator SetMissionProgressOnServer(bool i_bCompleted)
        {
            List <SingleMissionProgress> listProgress = new List <SingleMissionProgress>();

            listProgress.Add(new SingleMissionProgress()
            {
                Completed = i_bCompleted
            });

            WorldMissionProgress progressForWorld = new WorldMissionProgress();

            progressForWorld.World    = MISSION_WORLD;
            progressForWorld.Missions = listProgress;

            Dictionary <string, WorldMissionProgress> dictData = new Dictionary <string, WorldMissionProgress>()
            {
                { MISSION_WORLD, progressForWorld }
            };

            IntegrationTestUtils.SetReadOnlyData(BackendConstants.MISSION_PROGRESS, JsonConvert.SerializeObject(dictData));

            yield return(mBackend.WaitUntilNotBusy());
        }
예제 #21
0
        private void SetUnitProgressData()
        {
            string unitProgressData = GetUnitProgressData();

            IntegrationTestUtils.SetReadOnlyData(IntegrationTestUtils.SAVE_KEY_UNITS, unitProgressData);
        }
예제 #22
0
        private IEnumerator ClearUnitModifierData()
        {
            IntegrationTestUtils.SetReadOnlyData(IntegrationTestUtils.SAVE_KEY_GUILDS, "{\"GUILD_1\":{\"Level\":0,\"Points\":0}}");

            yield return(mBackend.WaitUntilNotBusy());
        }
        private void SetBuildingProgressData()
        {
            string progressData = "{\"BASE_WARRIOR_BUILDING_1\":{\"Level\":100}}";

            IntegrationTestUtils.SetReadOnlyData(IntegrationTestUtils.SAVE_KEY_BUILDINGS, progressData);
        }
예제 #24
0
 private void SetBuildingDataOnServer()
 {
     IntegrationTestUtils.SetReadOnlyData(IntegrationTestUtils.SAVE_KEY_BUILDINGS, START_BUILDING_PROGRESS);
 }
예제 #25
0
 private void SetUnitDataOnServer()
 {
     IntegrationTestUtils.SetReadOnlyData(IntegrationTestUtils.SAVE_KEY_UNITS, START_UNIT_PROGRESS);
 }
 protected void SetTrainerCount(int i_trainers)
 {
     IntegrationTestUtils.SetReadOnlyData(TRAINER_DATA_KEY, DrsStringUtils.Replace(TRAINER_DATA, "NUM", i_trainers));
 }
예제 #27
0
        private void SetMissionProgressSaveData()
        {
            Dictionary <string, WorldMissionProgress> progress = GetMissionProgressForPlayer();

            IntegrationTestUtils.SetReadOnlyData(BackendConstants.MISSION_PROGRESS, JsonConvert.SerializeObject(progress));
        }