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(); }
public void FizzBuzz(int n, string expectedResult) { Assert.That(FizzBuzzer.GetValue(n), Is.EqualTo(expectedResult)); }