Ejemplo n.º 1
0
        public void WhenAllMatchExactly_4Bulls0Cows()
        {
            // Arrange & Act:
            var trial = new BullsNCows("1234", "1234");

            // Assert:
            Assert.Equal(4, trial.Bulls);
            Assert.Equal(0, trial.Cows);
        }
Ejemplo n.º 2
0
        public void WhenSomeMatchSomeExist_BullsNCows()
        {
            // Arrange & Act:
            var trial = new BullsNCows("4857", "4750");

            // Assert:
            Assert.Equal(2, trial.Bulls);
            Assert.Equal(1, trial.Cows);
        }
Ejemplo n.º 3
0
        public void WhenAllExistButNoneMatch_0Bulls4Cows()
        {
            // Arrange & Act:
            var trial = new BullsNCows("7654", "4567");

            // Assert:
            Assert.Equal(0, trial.Bulls);
            Assert.Equal(4, trial.Cows);
        }
Ejemplo n.º 4
0
        public void WhenNoneMatch_0Bulls0Cows()
        {
            // Arrange & Act:
            var trial = new BullsNCows("2345", "6987");

            // Assert:
            Assert.Equal(0, trial.Bulls);
            Assert.Equal(0, trial.Cows);
        }
Ejemplo n.º 5
0
 /**
  * summary: The function compares a given <see cref="BullsNCows"/> object to this one.
  */
 public bool Equals(BullsNCows other)
 {
     return(Bulls == other.Bulls && Cows == other.Cows);
 }
Ejemplo n.º 6
0
 public void UpdateComputerWithPlayerAnswer(BullsNCows playerAnswer)
 {
     currentGameEngine.EliminateRedundantGuesses(playerAnswer, ModelComputer.CurrentGuess);
 }