예제 #1
0
 private void Initialize()
 {
     this.numberToGuess = new SecretNumber();
     this.numberOfMoves = 0;
     this.numberOfCheats = 0;
     this.isGuessed = false;
 }
예제 #2
0
 public void RandomNumberToGuessGeneratorDifferentNumbers()
 {
     BullsAndCows.SecretNumber randomNumber1 = new BullsAndCows.SecretNumber();
     System.Threading.Thread.Sleep(10);
     BullsAndCows.SecretNumber randomNumber2 = new BullsAndCows.SecretNumber();
     System.Threading.Thread.Sleep(10);
     BullsAndCows.SecretNumber randomNumber3 = new BullsAndCows.SecretNumber();
     Assert.IsFalse((randomNumber1.Value == randomNumber2.Value) && (randomNumber2.Value == randomNumber3.Value));
 }
예제 #3
0
        public void RevealedFourTimesSecretNumberIsCorrect()
        {
            SecretNumber secretNumberTest = new SecretNumber();
            secretNumberTest.GetHelpingNumber();
            secretNumberTest.GetHelpingNumber();
            secretNumberTest.GetHelpingNumber();
            string actual = secretNumberTest.GetHelpingNumber();

            Assert.AreEqual("The number looks like " + secretNumberTest.Value + "." + Environment.NewLine,actual);
        }
예제 #4
0
        public void NumberToGuessIsGenerated()
        {
            SecretNumber secretNumberTest = new SecretNumber();

            Assert.AreNotEqual(null,secretNumberTest.Value);
        }