public void Test10() { int actual = PrimeMethods.GetPrime(10); int expected = 29; Assert.Equal(expected, actual); }
public void Test9() { int actual = PrimeMethods.GetPrime(9); int expected = 23; Assert.Equal(expected, actual); }
public void Test8() { int actual = PrimeMethods.GetPrime(8); int expected = 19; Assert.Equal(expected, actual); }
public void Test4() { int actual = PrimeMethods.GetPrime(4); int expected = 7; Assert.Equal(expected, actual); }
public void Test12() { int actual = PrimeMethods.GetPrime(12); int expected = 37; Assert.Equal(expected, actual); }
static void Main(string[] args) { string willContinue = "y"; Console.WriteLine("\n" + "\n" + "I will find you any prime number, in order, from the first prime number on.\n" + ""); while (willContinue == "y") { Console.WriteLine("Which prime number are you looking for? "); int num = int.Parse(Console.ReadLine()); Console.WriteLine(PrimeMethods.GetPrime(num)); Console.WriteLine("Do you want to find another prime number? y/n"); willContinue = Console.ReadLine().ToLower(); } Console.WriteLine("Have a good day!"); }