You should read the input typed by the user when he/she presses the enter key.
This is done using Console.ReadLine. But you have a problem in the following Convert.ToInt32.
If the user doesn't type something that could be converted to an integer your code will crash.
The correct method to read an integer from the console is
int intValue;
string input = Console.ReadLine();
if(Int32.TryParse(input, out intValue))
Console.WriteLine("Correct number typed");
else
Console.WriteLine("The input is not a valid integer");
The Int32.TryParse method will try to convert the input string to a valid integer. If the conversion is possible then it will set the integer passed via out parameter and returns true. Otherwise, the integer passed will be set to the default value for integers (zero) and the method returns false.
TryParse doesn't throw an expensive exception like Convert.ToInt32 or the simple Int.Parse methods
myObject.testFuction?