예제 #1
0
        static void Main(string[] args)
        {
            for (int i = 1; i <= 100; i++)
            {
                string result = FizzBuzzer.GetResult(i);
                int    j;
                bool   isNumber = int.TryParse(result, out j);

                Console.ForegroundColor = isNumber ? ConsoleColor.Red : ConsoleColor.Green;

                Console.WriteLine(FizzBuzzer.GetResult(i));
            }

            Console.ReadLine();
        }
예제 #2
0
 public void FizzBuzz(int n, string expectedResult)
 {
     Assert.That(FizzBuzzer.GetValue(n), Is.EqualTo(expectedResult));
 }