AddRule() public méthode

public AddRule ( int number, string word ) : void
number int
word string
Résultat void
Exemple #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);
        }
Exemple #2
0
        public void PassDivisibleBy7GetBanana()
        {
            var fizzBuzz = new FizzBuzzer();
            fizzBuzz.AddRule(7, "Banana");
            var result = fizzBuzz.ToString(7);

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

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