Beispiel #1
0
            public IEnumerator WHEN_FillAllGameDataFunctionCalled_THEN_GameDataIsFilled()
            {
                // Make all games labelled as played
                Globals.isBalloonsButtonOn     = false;
                Globals.isCTFButtonOn          = false;
                Globals.isImageHitButtonOn     = false;
                Globals.isSquaresButtonOn      = false;
                Globals.isCatchTheBallButtonOn = false;
                Globals.isJudgeTheBallButtonOn = false;
                Globals.isSaveOneBallButtonOn  = false;

                BatterySessionManagement batterySessionManagement = new BatterySessionManagement();

                batterySessionManagement.FillAllGameData();

                yield return(null);

                // Game data should be filled with actual gameplay data from each game
                Assert.AreEqual(Balloons.GetGameplayData(), batterySessionManagement.balloonsData);
                Assert.AreEqual(CatchTheThief.GetGameplayData(), batterySessionManagement.ctfData);
                Assert.AreEqual(Squares.GetGameplayData(), batterySessionManagement.squaresData);
                Assert.AreEqual(ImageHit.GetGameplayData(), batterySessionManagement.imageHitData);
                Assert.AreEqual(CatchTheBall.GetGameplayData(), batterySessionManagement.catchTheBallData);
                Assert.AreEqual(JudgeTheBall.GetGameplayData(), batterySessionManagement.judgeTheBallData);
                Assert.AreEqual(SaveOneBall.GetGameplayData(), batterySessionManagement.saveOneBallData);
            }
        /// <summary>
        /// FillAllGameData is to update game data objects with corresponding raw gameplay data.
        /// It will only get gameplay data for the games that have been played.
        /// </summary>
        public void FillAllGameData()
        {
            // Get gameplay data for Balloons
            // If the game has been played, get the gameplay data; else, skip this game
            if (!notYetPlayBalloons)
            {
                balloonsData = Balloons.GetGameplayData();
            }

            // Get gameplay data for Squares
            // If the game has been played, get the gameplay data; else, skip this game
            if (!notYetPlaySquares)
            {
                squaresData = Squares.GetGameplayData();
            }


            // Get gameplay data for Catch The Thief
            // If the game has been played, get the gameplay data; else, skip this game
            if (!notYetPlayCTF)
            {
                ctfData = CatchTheThief.GetGameplayData();
            }

            // Get gameplay data for ImageHit
            // If the game has been played, get the gameplay data; else, skip this game
            if (!notYetPlayImageHit)
            {
                imageHitData = ImageHit.GetGameplayData();
            }

            // Get gameplay data for Catch The Ball
            // If the game has been played, get the gameplay data; else, skip this game
            if (!notYetCatchTheBall)
            {
                catchTheBallData = CatchTheBall.GetGameplayData();
            }

            // Get gameplay data for Save One Ball
            // If the game has been played, get the gameplay data; else, skip this game
            if (!notYetSaveOneBall)
            {
                saveOneBallData = SaveOneBall.GetGameplayData();
            }

            // Get gameplay data for Judge The Ball
            // If the game has been played, get the gameplay data; else, skip this game
            if (!notYetJudgeTheBall)
            {
                judgeTheBallData = JudgeTheBall.GetGameplayData();
            }
        }