예제 #1
0
        public void GetCorrectStringForCustomRule()
        {
            FizzBuzz fizzBuzz = new FizzBuzz();

            fizzBuzz.AddRule(18, "Banana");

            var numberAsString = fizzBuzz.GetStringRepresentationFor(18);

            Assert.AreEqual("FizzBanana", numberAsString);
        }
예제 #2
0
        public void ChangingRule()
        {
            FizzBuzz fizzBuzz = new FizzBuzz();

            fizzBuzz.ChangeRule(3, "Buzz");
            fizzBuzz.ChangeRule(5, "Fizz");

            string numberAsString = fizzBuzz.GetStringRepresentationFor(15);

            Assert.AreEqual("BuzzFizz", numberAsString);
        }
예제 #3
0
        public void GetCorrectStringForNumberOne()
        {
            string numberAsString = _fizzBuzz.GetStringRepresentationFor(1);

            Assert.AreEqual("1", numberAsString);
        }