Ejemplo n.º 1
0
            public IEnumerator TestBalloonsScore_RoundsPlayed()
            {
                ClearPointingMeasure();

                // Add 10 balloonRound to balloonsData
                for (int i = 0; i < 10; i++)
                {
                    PointingMeasure.balloonsData.Rounds.Add(balloonRound);
                }
                // Call Evaluate function
                PointingMeasure.EvaluateBalloonsScore();
                int score_10Rounds = PointingMeasure.subScoreBalloons.Score;

                ClearPointingMeasure();

                // Add 20 balloonRound to balloonsData
                for (int i = 0; i < 20; i++)
                {
                    PointingMeasure.balloonsData.Rounds.Add(balloonRound);
                }
                // Call Evaluate function
                PointingMeasure.EvaluateBalloonsScore();
                int score_20Rounds = PointingMeasure.subScoreBalloons.Score;

                yield return(null);

                // Test that fewer rounds played should result a lower score
                Assert.IsTrue(score_10Rounds < score_20Rounds);
            }
        //Helper functions start
        //---------------------------------------------------------
        //---------------------------------------------------------

        /// <summary>
        /// MeasureAllGames is called when all games end. It will call methods of
        /// evaluating scores for all abilities.
        /// </summary>
        private static void MeasureAllGames()
        {
            // Measure abilities for Balloons
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetPlayBalloons)
            {
                PointingMeasure.EvaluateBalloonsScore();
                SelectiveVisualMeasure.EvaluateBalloonsScore();
                InhibitionMeasure.EvaluateBalloonsScore();
            }

            // Measure abilities for Squares
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetPlaySquares)
            {
                SelectiveVisualMeasure.EvaluateSquaresScore();
                VisuospatialSketchpadMeasure.EvaluateSquaresScore();
            }

            // Measure abilities for Catch The Thief
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetPlayCTF)
            {
                InhibitionMeasure.EvaluateCTFScore();
                SelectiveVisualMeasure.EvaluateCTFScore();
            }

            // Measure abilities for ImageHit
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetPlayImageHit)
            {
                ObjectRecognitionMeasure.EvaluateImageHitScore();
                InhibitionMeasure.EvaluateImageHitScore();
                SelectiveVisualMeasure.EvaluateImageHitScore();
            }

            // Measure abilities for Catch The Ball
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetCatchTheBall)
            {
                TimeToContact.EvaluateCatchTheBallScore();
            }

            // Measure abilities for Save One Ball
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetSaveOneBall)
            {
                TimeToContact.EvaluateSaveOneBallScore();
            }

            // Measure abilities for Judge The Ball
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetJudgeTheBall)
            {
                TimeToContact.EvaluateJudgeTheBallScore();
            }
        }
Ejemplo n.º 3
0
            public IEnumerator WHEN_EvaluateBalloonsScoreFunctionCalled_BalloonsSubScoreDerived()
            {
                ClearPointingMeasure();

                // Call tested function
                PointingMeasure.EvaluateBalloonsScore();

                yield return(null);

                Assert.AreEqual(AbilityName.POINTING, PointingMeasure.subScoreBalloons.AbilityName);
                Assert.AreEqual(GameName.BALLOONS, PointingMeasure.subScoreBalloons.GameName);
                Assert.AreEqual(0, PointingMeasure.subScoreBalloons.Score);
                Assert.AreEqual(2, PointingMeasure.subScoreBalloons.Weight);
            }
Ejemplo n.º 4
0
            public IEnumerator WHEN_GetSubScoreForBalloonsFunctionCalled_BalloonsSubScoreReturned()
            {
                ClearPointingMeasure();

                // Set values for PointingMeasure.subScoreBalloons
                PointingMeasure.subScoreBalloons.AbilityName = AbilityName.POINTING;
                PointingMeasure.subScoreBalloons.GameName    = GameName.BALLOONS;
                PointingMeasure.subScoreBalloons.Score       = 65;
                PointingMeasure.subScoreBalloons.Weight      = 2;

                // Call tested function
                SubscoreStorage returnedSubscoreBalloons = PointingMeasure.GetSubScoreForBalloons();
                SubscoreStorage expectedSubscoreBalloons = PointingMeasure.subScoreBalloons;

                yield return(null);

                // Test PointingMeasure.subScoreBalloons is correctly returned
                Assert.AreEqual(expectedSubscoreBalloons.AbilityName, returnedSubscoreBalloons.AbilityName);
                Assert.AreEqual(expectedSubscoreBalloons.GameName, returnedSubscoreBalloons.GameName);
                Assert.AreEqual(expectedSubscoreBalloons.Score, returnedSubscoreBalloons.Score);
                Assert.AreEqual(expectedSubscoreBalloons.Weight, returnedSubscoreBalloons.Weight);
            }
Ejemplo n.º 5
0
            public IEnumerator TestBalloonsScore_MultipleClicks()
            {
                ClearPointingMeasure();

                // Add balloonRound to balloonsData
                PointingMeasure.balloonsData.Rounds.Add(balloonRound);
                // Call Evaluate function
                PointingMeasure.EvaluateBalloonsScore();
                int score_normal = PointingMeasure.subScoreBalloons.Score;

                ClearPointingMeasure();

                // Add balloonRound_hasMultipleClicks to balloonsData
                PointingMeasure.balloonsData.Rounds.Add(balloonRound_hasMultipleClicks);
                // Call Evaluate function
                PointingMeasure.EvaluateBalloonsScore();
                int score_multipleClicks = PointingMeasure.subScoreBalloons.Score;

                yield return(null);

                // Test that more clicks should result a lower score
                Assert.IsTrue(score_normal > score_multipleClicks);
            }
Ejemplo n.º 6
0
            public IEnumerator TestBalloonsScore_Distance()
            {
                ClearPointingMeasure();

                // Add balloonRound to balloonsData
                PointingMeasure.balloonsData.Rounds.Add(balloonRound);
                // Call Evaluate function
                PointingMeasure.EvaluateBalloonsScore();
                int score_normal = PointingMeasure.subScoreBalloons.Score;

                ClearPointingMeasure();

                // Add balloonRound_longDistance to balloonsData
                PointingMeasure.balloonsData.Rounds.Add(balloonRound_longDistance);
                // Call Evaluate function
                PointingMeasure.EvaluateBalloonsScore();
                int score_longDistance = PointingMeasure.subScoreBalloons.Score;

                yield return(null);

                // Test that long distance should result a lower score
                Assert.IsTrue(score_normal > score_longDistance);
            }
Ejemplo n.º 7
0
            public IEnumerator TestBalloonsScore_ShortestPossibleDestinationClickTime()
            {
                ClearPointingMeasure();

                // Add balloonRound to balloonsData
                PointingMeasure.balloonsData.Rounds.Add(balloonRound);
                // Call Evaluate function
                PointingMeasure.EvaluateBalloonsScore();
                int score_normal = PointingMeasure.subScoreBalloons.Score;

                ClearPointingMeasure();

                // Add balloonRound_shortestPossibleDestClickTime to balloonsData
                PointingMeasure.balloonsData.Rounds.Add(balloonRound_shortestPossibleDestClickTime);
                // Call Evaluate function
                PointingMeasure.EvaluateBalloonsScore();
                int score_shortestDesClickTime = PointingMeasure.subScoreBalloons.Score;

                yield return(null);

                // Test that shortest possible destination click time should result a higher score
                Assert.IsTrue(score_normal < score_shortestDesClickTime);
            }
        /// <summary>
        /// UpdateSubScoreSeq is to derive all subscore records and
        /// add these records to the subScoreSeq.
        /// </summary>
        private static void UpdateSubScoreSeq()
        {
            // Update subscores of abilities tested by Balloons and add them to sequence
            // If the game has been played, update the score
            if (!notYetPlayBalloons)
            {
                //get subscore for (Flicking, Balloons)
                SubscoreStorage flicking_balloons = PointingMeasure.GetSubScoreForBalloons();
                //get subscore for (Inhibition, Balloons)
                SubscoreStorage inhibition_balloons = InhibitionMeasure.GetSubScoreForBalloons();
                //get subscore for (Selective Visual, Balloons)
                SubscoreStorage selectiveVisual_balloons = SelectiveVisualMeasure.GetSubScoreForBalloons();

                //add subScore to subScoreSeq
                subScoreSeq.Add(flicking_balloons);
                subScoreSeq.Add(inhibition_balloons);
                subScoreSeq.Add(selectiveVisual_balloons);
            }

            // Update subscores of abilities tested by Squares and add them to sequence
            // If the game has been played, update the score
            if (!notYetPlaySquares)
            {
                //get subscore for (Selective Visual, Squares)
                SubscoreStorage selectiveVisual_squares = SelectiveVisualMeasure.GetSubScoreForSquares();
                //get subscore for (Visuospatial Sketchpad, Squares)
                SubscoreStorage visuospatialSketchpad_squares = VisuospatialSketchpadMeasure.GetSubScoreForSquares();

                //add subScore to subScoreSeq
                subScoreSeq.Add(selectiveVisual_squares);
                subScoreSeq.Add(visuospatialSketchpad_squares);
            }

            // Update subscores of abilities tested by Catch The Thief and add them to sequence
            // If the game has been played, update the score
            if (!notYetPlayCTF)
            {
                //get subscore for (Inhibition, Catch The Thief)
                SubscoreStorage inhibition_ctf = InhibitionMeasure.GetSubScoreForCTF();
                //get subscore for  (Selective Visual, Catch The Thief)
                SubscoreStorage selectiveVisual_ctf = SelectiveVisualMeasure.GetSubScoreForCTF();

                //add subScore to subScoreSeq
                subScoreSeq.Add(inhibition_ctf);
                subScoreSeq.Add(selectiveVisual_ctf);
            }

            // Update subscores of abilities tested by ImageHit and add them to sequence
            // If the game has been played, update the score
            if (!notYetPlayImageHit)
            {
                //get subscore for (Object Recognition, ImageHit)
                SubscoreStorage objectRecognition_imageHit = ObjectRecognitionMeasure.GetSubScoreForImageHit();
                //get subscore for (Inhibition, ImageHit)
                SubscoreStorage inhibition_imageHit = InhibitionMeasure.GetSubScoreForImageHit();
                //get subscore for  (Selective Visual, ImageHit)
                SubscoreStorage selectiveVisual_imageHit = SelectiveVisualMeasure.GetSubScoreForImageHit();

                //add subScore to subScoreSeq
                subScoreSeq.Add(objectRecognition_imageHit);
                subScoreSeq.Add(inhibition_imageHit);
                subScoreSeq.Add(selectiveVisual_imageHit);
            }

            // Update subscores of abilities tested by Catch The Ball and add them to sequence
            // If the game has been played, update the score
            if (!notYetCatchTheBall)
            {
                //get subscore for (Time To Contact, Catch The Ball)
                SubscoreStorage timeToContact_catchTheBall = TimeToContact.GetSubScoreForCatchTheBall();

                //add subScore to subScoreSeq
                subScoreSeq.Add(timeToContact_catchTheBall);
            }

            // Update subscores of abilities tested by Save One Ball and add them to sequence
            // If the game has been played, update the score
            if (!notYetSaveOneBall)
            {
                //get subscore for (Time To Contact, Save One Ball)
                SubscoreStorage timeToContact_saveOneBall = TimeToContact.GetSubScoreForSaveOneBall();

                //add subScore to subScoreSeq
                subScoreSeq.Add(timeToContact_saveOneBall);
            }

            // Update subscores of abilities tested by Judge The Ball and add them to sequence
            // If the game has been played, update the score
            if (!notYetJudgeTheBall)
            {
                //get subscore for (Time To Contact, Judge The Ball)
                SubscoreStorage timeToContact_judgeTheBall = TimeToContact.GetSubScoreForJudgeTheBall();

                //add subScore to subScoreSeq
                subScoreSeq.Add(timeToContact_judgeTheBall);
            }
        }