AddRule() public method

public AddRule ( int number, string word ) : void
number int
word string
return void
Esempio n. 1
0
        public void PassDivisibleBy2And3And5And7GetCoconutFizzBuzzBanana()
        {
            var fizzBuzz = new FizzBuzzer();
            fizzBuzz.AddRule(2, "Coconut");
            fizzBuzz.AddRule(7, "Banana");
            var result = fizzBuzz.ToString(210);

            Assert.AreEqual("Coconut Fizz Buzz Banana", result);
        }
Esempio n. 2
0
        public void PassDivisibleBy7GetBanana()
        {
            var fizzBuzz = new FizzBuzzer();
            fizzBuzz.AddRule(7, "Banana");
            var result = fizzBuzz.ToString(7);

            Assert.AreEqual("Banana", result);
        }
Esempio n. 3
0
        public void PassDivisibleBy2GetCoconut()
        {
            var fizzBuzz = new FizzBuzzer();
            fizzBuzz.AddRule(2, "Coconut");
            var result = fizzBuzz.ToString(2);

            Assert.AreEqual("Coconut", result);
        }