public void ThreeIsNotCorrectBullsCountFor9734() { Bull bullTest = new Bull("9734", "9943", new bool[4]); string actual = bullTest.GetPrintableCount(); Assert.AreNotEqual("Bulls: 3 ", actual, "Bull counting logic problem."); }
public void OneIsCorrectCowsCountFor1786() { bool[] isBull = new bool[4]; Bull bullTest = new Bull("1786", "6187", isBull); Cow cowTest = new Cow("1786", "6187", isBull); string actual = cowTest.GetPrintableCount(); Assert.AreEqual("Cows: 4", actual, "Cow counting logic problem."); }
public void OneIsNotCorrectBullsCountFor2901() { Bull bullTest = new Bull("2901", "2400", new bool[4]); string actual = bullTest.GetPrintableCount(); Assert.AreNotEqual("Bulls: 1 ", actual, "Bull counting logic problem."); }
public void FourIsCorrectBullsCountFor0000() { Bull bullTest = new Bull("0000", "0000", new bool[4]); string actual = bullTest.GetPrintableCount(); Assert.AreEqual("Bulls: 4 ", actual, "Bull counting logic problem."); }
public void OneIsCorrectBullsCountFor3331() { Bull bullTest = new Bull("3331", "3462", new bool[4]); string actual = bullTest.GetPrintableCount(); Assert.AreEqual("Bulls: 1 ", actual, "Bull counting logic problem."); }
public void TwoIsCorrectBullsCountFor2653() { Bull bullTest = new Bull("2653", "2352", new bool[4]); string actual = bullTest.GetPrintableCount(); Assert.AreEqual("Bulls: 2 ", actual, "Bull counting logic problem."); }
public void ZeroIsNotCorrectCowsCountFor1923() { bool[] isBull = new bool[4]; Bull bullTest = new Bull("1923", "1093", isBull); Cow cowTest = new Cow("1923", "1093", isBull); string actual = cowTest.GetPrintableCount(); Assert.AreNotEqual("Cows: 0", actual, "Cow counting logic problem."); }
public void ThreeIsCorrectCowsCountFor2996() { bool[] isBull = new bool[4]; Bull bullTest = new Bull("2296", "2296", isBull); Cow cowTest = new Cow("2296", "2292", isBull); string actual = cowTest.GetPrintableCount(); Assert.AreEqual("Cows: 3", actual, "Cow counting logic problem."); }
public void SevenIsNotCorrectCowsCountFor9067() { bool[] isBull = new bool[4]; Bull bullTest = new Bull("9067", "0185", isBull); Cow cowTest = new Cow("9067", "0185", isBull); string actual = cowTest.GetPrintableCount(); Assert.AreNotEqual("Cows: 7", actual, "Cow counting logic problem."); }
public void EmptyBoolArrayForBullsIsNotAllowed() { Bull bullTest = new Bull("5331", "2178", null); }
public void EmptyTryNumberIsNotAllowed() { Bull bullTest = new Bull("4390", null, new bool[4]); }
public void EmptyNumberForGuessIsNotAllowed() { Bull bullTest = new Bull(null, "3462", new bool[4]); }
private void ProcessNextMove(string numberToTry) { this.numberOfMoves++; if (this.numberToGuess.IsEqualToNumberForTry(numberToTry)) { this.isGuessed = true; UserInterface.PrintCongratulationMessage(this.numberOfMoves, this.numberOfCheats); } else { bool[] isBull = new bool[4]; Bull bull = new Bull(this.numberToGuess.Value, numberToTry, isBull); Cow cow = new Cow(this.numberToGuess.Value, numberToTry,isBull); Console.Write("Wrong number! "); string bullCount = bull.GetPrintableCount(); Console.Write(bullCount); string cowCount = cow.GetPrintableCount(); Console.WriteLine(cowCount); } }