示例#1
0
        public void DoFizzBuzzUpTo()
        {
            var actual  = new K03FizzBuzz().DoFizzBuzzUpTo(36).ToList();
            var expeted = new[] { "1", "2", "Fizz", "4", "Buzz", "Fizz", "7", "8", "Fizz", "Buzz", "11", "Fizz", "13", "14", "Fizz Buzz", "16", "17", "Fizz", "19", "Buzz", "Fizz", "22", "23", "Fizz", "Buzz", "26", "Fizz", "28", "29", "Fizz Buzz", "31", "32", "Fizz", "34", "Buzz", "Fizz" };

            Assert.AreEqual(actual.Count(), expeted.Length);
        }
示例#2
0
        public void MapNumber_DivideByNeitherThreeNorFive_Number()
        {
            var fizzBuzz = new K03FizzBuzz();

            Assert.AreEqual("2", fizzBuzz.MapNumber(2));
        }
示例#3
0
        public void MapNumber_DivideByThreeAndFive_FizzBuzz()
        {
            var fizzBuzz = new K03FizzBuzz();

            Assert.AreEqual("Fizz Buzz", fizzBuzz.MapNumber(15));
        }