Esempio n. 1
0
        public void AddingRuleRange()
        {
            FizzBuzz fizzBuzz = new FizzBuzz();

            fizzBuzz.AddRuleRange(new Dictionary <int, string>
            {
                { 2, "Banana" },
                { 17, "Orange" },
            });

            Assert.AreEqual(true, fizzBuzz.IsRuleExistsFor(2));
            Assert.AreEqual(true, fizzBuzz.IsRuleExistsFor(17));
        }
Esempio n. 2
0
        public void AddingRule()
        {
            FizzBuzz fizzBuzz = new FizzBuzz();

            fizzBuzz.AddRule(18, "Banana");

            Assert.AreEqual(true, fizzBuzz.IsRuleExistsFor(18));
        }
Esempio n. 3
0
        public void RemovingRule()
        {
            FizzBuzz fizzBuzz = new FizzBuzz();

            fizzBuzz.AddRule(18, "Banana");
            fizzBuzz.RemoveRuleFor(18);

            Assert.AreEqual(false, fizzBuzz.IsRuleExistsFor(18));
        }
Esempio n. 4
0
 public void CheckRuleExists()
 {
     Assert.AreEqual(true, _fizzBuzz.IsRuleExistsFor(3));
     Assert.AreEqual(false, _fizzBuzz.IsRuleExistsFor(1));
 }