Пример #1
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());
        }
 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 SetStartingSaveLevelAndData(int i_level)
        {
            mCurrentTestData.SaveValue = DrsStringUtils.Replace(mCurrentTestData.SaveValue, "LEVEL", i_level);

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

            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 override IEnumerator SetMissionDataOnServer()
        {
            MapData map  = CreateMapData();
            string  data = JsonConvert.SerializeObject(map);

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

            yield return(mBackend.WaitUntilNotBusy());
        }
Пример #6
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 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);
        }
Пример #8
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");
        }
Пример #9
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");
        }
        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));
        }
Пример #11
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());
        }
Пример #14
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());
        }
Пример #15
0
        private void SetUnitProgressData()
        {
            string unitProgressData = GetUnitProgressData();

            IntegrationTestUtils.SetReadOnlyData(IntegrationTestUtils.SAVE_KEY_UNITS, unitProgressData);
        }
Пример #16
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);
        }
 protected void SetTrainerCount(int i_trainers)
 {
     IntegrationTestUtils.SetReadOnlyData(TRAINER_DATA_KEY, DrsStringUtils.Replace(TRAINER_DATA, "NUM", i_trainers));
 }
Пример #19
0
 private void SetBuildingDataOnServer()
 {
     IntegrationTestUtils.SetReadOnlyData(IntegrationTestUtils.SAVE_KEY_BUILDINGS, START_BUILDING_PROGRESS);
 }
Пример #20
0
 private void SetUnitDataOnServer()
 {
     IntegrationTestUtils.SetReadOnlyData(IntegrationTestUtils.SAVE_KEY_UNITS, START_UNIT_PROGRESS);
 }
Пример #21
0
        private void SetMissionProgressSaveData()
        {
            Dictionary <string, WorldMissionProgress> progress = GetMissionProgressForPlayer();

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