示例#1
0
        public void WhenDivisibleBy5ReturnBuzz()
        {
            var source = new[] {5, 10, 20};
            var rules = new Dictionary<int, string> {{5, "Buzz"}};

            var actual = source.TestValues(rules).ToArray();

            Assert.IsTrue(actual.All(e => e == "Buzz"));
        }
示例#2
0
        public void WhenDivisibleBy5And3ReturnFizz_Buzz()
        {
            var source = new[] {15, 30, 90};
            var rules = new Dictionary<int, string> {{3, "Fizz"}, {5, "Buzz"}};

            var actual = source.TestValues(rules).ToArray();

            Assert.IsTrue(actual.All(e => e == "Fizz Buzz"));
        }
示例#3
0
        public void WhenNotDivisibleBy3Or5ReturnNumber()
        {
            var source = new[] {4, 7, 11};
            var rules = new Dictionary<int, string>();

            var actual = source.TestValues(rules).ToArray();

            Assert.AreEqual("4", actual[0]);
            Assert.AreEqual("7", actual[1]);
            Assert.AreEqual("11", actual[2]);
        }