Ejemplo n.º 1
0
        public void GetNextIncreasesCurrentNumberIn1()
        {
            var game = new FizzBuzzGame();

            for (int i = 0; i < 100; i++)
            {
                var currentNumber = game.CurrentNumber;

                game.GetNext();

                Assert.AreEqual(game.CurrentNumber, currentNumber + 1);
            }
        }
Ejemplo n.º 2
0
        public void GetNextReturnsFizzBuzzIfTheNextNumberInTheSequenceIsDivisibleBy15()
        {
            var game = new FizzBuzzGame();

            for (int i = 0; i < 100; i++)
            {
                var currentNumber = game.CurrentNumber;
                var nextNumber    = currentNumber + 1;
                var response      = game.GetNext();

                if (nextNumber % 15 == 0)
                {
                    Assert.AreEqual(response, FizzBuzzGame.FizzBuzz);
                }
            }
        }
Ejemplo n.º 3
0
        public void GetNextReturnsTheNumberIfTheNextNumberInTheSequenceIsNotDivisibleBy5Or3()
        {
            var game = new FizzBuzzGame();

            for (int i = 0; i < 100; i++)
            {
                var currentNumber = game.CurrentNumber;
                var nextNumber    = currentNumber + 1;
                var response      = game.GetNext();

                if (nextNumber % 3 != 0 && nextNumber % 5 != 0)
                {
                    Assert.AreEqual(response, nextNumber.ToString());
                }
            }
        }