public void StartNewGame() { _codeChecker.GenerateSecretCode(); IsWinner = false; IsGameOver = false; Turns = new List <Turn>(); }
public void It_Should_Return_WhiteForEveryCorrectColourAtIncorrectPosition_When_Given_ValidGuesses(List <Peg> guess, List <Feedback> expectedFeedback) { //arrange var codeGenerator = new CodeGenerator(new List <Peg> { Peg.Red, Peg.Blue, Peg.Green, Peg.Yellow }); var nonRandomizer = new NonRandomizer(); var code = new CodeChecker(codeGenerator, nonRandomizer); code.GenerateSecretCode(); //act var feedback = code.CheckGuess(guess); //assert Assert.Equal(expectedFeedback, feedback); }
public void It_Should_Return_A_KnownSecretCode_When_A_StaticCodeGeneratorIsUsed() { //arrange var codeGenerator = new CodeGenerator(new List <Peg> { Peg.Red, Peg.Blue, Peg.Green, Peg.Yellow }); var nonRandomizer = new NonRandomizer(); var code = new CodeChecker(codeGenerator, nonRandomizer); //act code.GenerateSecretCode(); //assert var expectedSecretCode = new List <Peg> { Peg.Red, Peg.Blue, Peg.Green, Peg.Yellow }; Assert.True(code.SecretCode.SequenceEqual(expectedSecretCode)); }