public void TryToParsePlayerGuessMethodMethodCorrectTest() { PlayerGuess expected = new PlayerGuess(5, 6, 7, 8); PlayerGuess result = PlayerGuess.TryToParse("5678"); Assert.AreEqual(expected.ToString(), result.ToString()); }
public void NumberParametersConstructorCorrectTest() { PlayerGuess number = new PlayerGuess(1, 2, 3, 4); Assert.AreEqual(1, number.FirstDigit); Assert.AreEqual(2, number.SecondDigit); Assert.AreEqual(3, number.ThirdDigit); Assert.AreEqual(4, number.FourthDigit); }
public void GetBullsAndCowsMatchesOneCowTest() { GameNumber theNumber = new GameNumber(3, 0, 6, 8); PlayerGuess playerGuess = new PlayerGuess(4, 2, 9, 3); Result expected = new Result(0, 1); Result result = GuessChecker.GetBullsAndCowsMatches(playerGuess, theNumber); Assert.AreEqual(expected.ToString(), result.ToString()); }
public void GetBullsAndCowsMatchesThreeCowsTest() { GameNumber theNumber = new GameNumber(3, 0, 6, 8); PlayerGuess playerGuess = new PlayerGuess(1, 6, 3, 0); Result expected = new Result(0, 3); Result result = GuessChecker.GetBullsAndCowsMatches(playerGuess, theNumber); Assert.AreEqual(expected.ToString(), result.ToString()); }
public void TryToParsePlayerGuessMethodIncorrectInputTest() { PlayerGuess.TryToParse("wrong"); }
public void NumberConstructorFourthDigitAboveLimitTest() { PlayerGuess number = new PlayerGuess(1, 2, 3, 10); }
public void NumberConstructorThirdDigitAboveLimitTest() { PlayerGuess number = new PlayerGuess(1, 2, 10, 4); }
public void NumberConstructorSecondDigitAboveLimitTest() { PlayerGuess number = new PlayerGuess(1, 10, 3, 4); }
public void NumberConstructorFirstDigitAboveLimitTest() { PlayerGuess number = new PlayerGuess(10, 2, 3, 4); }
public void GetBullsAndCowsMatchesTwoBullsAndTwoCowsTest() { GameNumber theNumber = new GameNumber(3, 0, 6, 8); PlayerGuess playerGuess = new PlayerGuess(3, 6, 0, 8); Result expected = new Result(2, 2); Result result = GuessChecker.GetBullsAndCowsMatches(playerGuess, theNumber); Assert.AreEqual(expected.ToString(), result.ToString()); }