public void IsPingPong_NumberDivisibleBy3_True() { PingPong testPingPong = new PingPong(); Assert.AreEqual(true, testPingPong.IsPingPong(9)); Console.WriteLine("Ping-Pong"); }
public void IsPingPong_PrintPingPong_PingPong() { List <string> expected = new List <string> { "1", "2", "ping", "4", "pong", "ping", "7", "8", "ping", "pong", "11", "ping", "13", "14", "ping-pong" }; PingPong actual = new PingPong(); CollectionAssert.AreEqual(expected, actual.IsPingPong(15)); }
public void IsPingPong_PrintPing_Ping() { List <string> expected = new List <string> { "1", "2", "ping" }; PingPong actual = new PingPong(); CollectionAssert.AreEqual(expected, actual.IsPingPong(3)); }
public void IsPingPong_PrintOne_1() { List <string> expected = new List <string> { "1" }; PingPong actual = new PingPong(); CollectionAssert.AreEqual(expected, actual.IsPingPong(1)); }
private static void StartPingPong() { Console.Write("Please enter a positive number: "); int userInput; bool success = Int32.TryParse(Console.ReadLine(), out userInput); if (!success || userInput <= 0) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Invalid input"); Console.ResetColor(); StartPingPong(); } else { List <string> result = PingPong.IsPingPong(userInput); Console.ForegroundColor = ConsoleColor.Magenta; Console.WriteLine(string.Join(", ", result)); Console.ResetColor(); } }
public void IsPingPong() { PingPong testPingPong = new PingPong(); Assert.AreEqual(true, testPingPong.IsPingPong(16)); }
public void IsPingPong_NumberDivisibleByThreeAndFive_True() { // PingPong testPingPong = new PingPong(); Assert.AreEqual("ping pong", PingPong.IsPingPong(15)); }
public void IsPingPong_NumberNotDivisibleByThreeOrFive_True() { // PingPong testPingPong = new PingPong(); Assert.AreEqual("14", PingPong.IsPingPong(14)); }
public void IsPingPong_PingPongDivisibleByThreeAndFive_True() { PingPong testPingPong = new PingPong(); Assert.AreEqual(true, testPingPong.IsPingPong(15)); }
public void IsPingPong_NumberDivisibleByThree_Ping() { PingPong testPingPong = new PingPong(); Assert.AreEqual("ping", testPingPong.IsPingPong(3)); }
public void IsPingPong_NumberDivisibleByFive_Pong() { PingPong testPingPong = new PingPong(); Assert.AreEqual("pong", testPingPong.IsPingPong(5)); }