public void WHEN_EvaluateSaveOneBallScoreCalledWithNoData_THEN_ScoreOfNegative1IsObtained() { Setup(); TimeToContact.EvaluateSaveOneBallScore(); SubscoreStorage subscore = TimeToContact.GetSubScoreForSaveOneBall(); Assert.AreEqual(-1, subscore.Score); }
public void SaveOneBallSubScoreCalculatedAsAccuracyAverageBetweenRounds() { Setup(); TimeToContact.saveOneBallData = new SaveOneBallStorage { TargetRadius = DUMMY_TARGET_RADIUS, Rounds = new List <SaveOneBallStorage.BallRound> { new SaveOneBallStorage.BallRound { LeftActualTimeToContact = 3.5F, RightActualTimeToContact = 3.5F, PredictedTimeToContact = 5F, DidPredictFirstArrivingBall = true, }, new SaveOneBallStorage.BallRound { LeftActualTimeToContact = 5.6F, RightActualTimeToContact = 5.6F, PredictedTimeToContact = 5, DidPredictFirstArrivingBall = false }, new SaveOneBallStorage.BallRound { LeftActualTimeToContact = 9F, RightActualTimeToContact = 9F, PredictedTimeToContact = 8.3F, DidPredictFirstArrivingBall = true }, } }; TimeToContact.EvaluateSaveOneBallScore(); // FLOOR(1/3 * ((100 - |1 - 5/3.5|*100) + 0 + (100 - |1 - 8.3/9|*100))) = 49 Assert.AreEqual(49, TimeToContact.GetSubScoreForSaveOneBall().Score); }
public void WHEN_SaveOneBallPlayedPerfectlyInAllRounds_THEN_SubscoreOf100IsObtained() { Setup(); TimeToContact.saveOneBallData = new SaveOneBallStorage { TargetRadius = DUMMY_TARGET_RADIUS, Rounds = new List <SaveOneBallStorage.BallRound> { new SaveOneBallStorage.BallRound { LeftActualTimeToContact = 3.5F, RightActualTimeToContact = 3.5F, PredictedTimeToContact = 3.5F, DidPredictFirstArrivingBall = true }, new SaveOneBallStorage.BallRound { LeftActualTimeToContact = 5.6F, RightActualTimeToContact = 5.6F, PredictedTimeToContact = 5.6F, DidPredictFirstArrivingBall = true }, new SaveOneBallStorage.BallRound { LeftActualTimeToContact = 8.3F, RightActualTimeToContact = 8.3F, PredictedTimeToContact = 8.3F, DidPredictFirstArrivingBall = true }, } }; TimeToContact.EvaluateSaveOneBallScore(); Assert.AreEqual(100, TimeToContact.GetSubScoreForSaveOneBall().Score); }
/// <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); } }