public void TestMethod1() { int s = 0; int e = 100; Object[] fizzy = Fizz.fizzbuzzfunc(s, e); for (int i = 0; i < fizzy.Length - 1; i++) { if (i % 3 == 0 && i % 5 == 0) { Assert.AreEqual("Fizzbuzz", fizzy[i]); } else if (i % 3 == 0) { Assert.AreEqual("Fizz", fizzy[i]); } else if (i % 5 == 0) { Assert.AreEqual("Buzz", fizzy[i]); } else { Assert.AreEqual(i, fizzy[i]); } } }
static void Main(string[] args) { int s = 5; int e = 200; Object[] fizzy = Fizz.fizzbuzzfunc(s, e); foreach (Object elem in fizzy) { Console.WriteLine(elem); } }