public void TestFindBullsAndCowsCountForInputWithSpacesBetweenDigits() { BullsAndCowsGame_Accessor game = SetSecretNumberDigits(0, 0, 0, 0); string userNumber = "1 2 3 5"; Result actual = game.FindBullsAndCowsCount(userNumber); }
public void TestFindBullsAndCowsCountFor3DigitsAnd1Letter() { BullsAndCowsGame_Accessor game = SetSecretNumberDigits(0, 0, 0, 0); string userNumber = "123a"; Result actual = game.FindBullsAndCowsCount(userNumber); }
public void TestFindBullsAndCowsCountFor1BullByEqualDigits() { BullsAndCowsGame_Accessor game = SetSecretNumberDigits(0, 0, 0, 0); string userNumber = "0143"; Result expected = new Result(1, 0); Result actual = game.FindBullsAndCowsCount(userNumber); Assert.AreEqual <Result>(expected, actual, INCORRECT_COUNT_OF_BULLS_AND_COWS_MSG); }
public void TestGetStartValuesGuessesCount() { BullsAndCowsGame_Accessor game = new BullsAndCowsGame_Accessor(); game.FindBullsAndCowsCount("9999"); game.GetStartValues(); int expected = 0; int actual = game.GuessesCount; Assert.AreEqual <int>(expected, actual, "GetStartValues didn't intialize the guess count properly!"); }
public void TestExecuteCommandRestartCorrect() { BullsAndCowsGame_Accessor game = SetSecretNumberDigits(1, 2, 3, 4); game.FindBullsAndCowsCount("0000"); game.ExecuteCommand(null, "0000"); game.ExecuteCommand(null, "restart"); int expected = 0; int actual = game.GuessesCount; Assert.AreEqual <int>(expected, actual, EXECUTING_COMMAND_ERROR_MSG); }