public void ShouldNotSolveSecretCodeWhenResponseBlackPegsNotEqualsShieldCount(int blackKeyPegs, int whiteKeyPegs) { //Arrange var boardConfig = new BoardConfig(4, 10); var decodingBoard = new DecodingBoard(boardConfig); var colors = new[] { CodePeg.Black, CodePeg.Blue, CodePeg.Green, CodePeg.White }; var shield = new Shield(colors); decodingBoard.CodeMaker(shield); var response = new Response(blackKeyPegs, whiteKeyPegs); //Act var result = decodingBoard.HasSolvedSecretCode(response); //Assert result.Should().BeFalse(); }
public void ShouldThrowArgumentExceptionWhenResponseTotalKeyPegsOutsideBoundaries(int blackKeyPegs, int whiteKeyPegs) { //Arrange var boardConfig = new BoardConfig(4, 10); var decodingBoard = new DecodingBoard(boardConfig); var colors = new[] { CodePeg.Black, CodePeg.Blue, CodePeg.Green, CodePeg.White }; var shield = new Shield(colors); decodingBoard.CodeMaker(shield); var response = new Response(blackKeyPegs, whiteKeyPegs); //Act void Action() => decodingBoard.HasSolvedSecretCode(response); var exception = Record.Exception(Action); //Assert exception.Should().BeOfType <ArgumentException>(); }