As I understand it, the output means output the text to console (if it's is too file, it's trivial, is somewhere else, it would be uncertain); you only need to run some application writing to console under control of your C# application and compare output with some preset data.
Is it for teaching purposes?
OK, to do it, you need to run your application using
System.Diagnostics.Process.Start
redirecting the output the some stream supplied by your application.
I explained how to do such redirection in my past solutions:
How to read from command prompt[
^],
How to read console output with buffer (pipe)[
^].
—SA