I have a console application that reads input from console and writes output to console. I need to write another program that should run the first one, mock the console input for it and grab the output. Can you please provide a way of investigation for this problem?
The (very easy) example of console application code:
string input = Console.ReadLine();
int value = int.Parse(input);
Console.WriteLine(value * value);