public void TestWhenAnalysisHasNoHistory_ThenConfidenceIsVeryUnconfident() { var history = new MoveHistory_Accessor(); var target = new MoveAnalyzer_Accessor(history); Player you = new Player("Test", new MyBot()); you.Reset(GameRules.Default); target.Analyze(you); Confidence expected = Confidence.VeryUnconfident; Confidence actual = target.CurrentConfidence; Assert.AreEqual(expected, actual, "Odd that there is any confidence when there is no history."); }
public void TestWhenAnalysisEncountersARepeatedMove_ThenConfidenceIsVeryConfidentAndBestGuessIsDetermined() { var history = new MoveHistory_Accessor(); var target = new MoveAnalyzer_Accessor(history); Player you = new Player("Test", new MyBot()); you.Reset(GameRules.Default); history.OpponentMoveHistory.Add(Moves.Dynamite); history.OpponentMoveHistory.Add(Moves.Dynamite); history.OpponentMoveHistory.Add(Moves.Dynamite); target.Analyze(you); Confidence expected = Confidence.VeryConfident; Confidence actual = target.CurrentConfidence; Assert.AreEqual(expected, actual, "Confidence after the DDD pattern is not as expected."); Move expectedMove = Moves.WaterBalloon; Move actualMove = target.BestGuess; Assert.AreEqual(expectedMove, actualMove, "Best guess after the DDD pattern is not as expected."); }