title: How to unit test a console program that reads input and writes to the console
body: <p>Let's say I have a simple program like </p>
  
  <pre><code>using System;
  
  public class Solution
  {
      public static void Main(string[] args)
      {
          int[] arr = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
          Array.Sort(arr);
          Console.WriteLine(string.Join(" ", arr));
      }
  }
  </code></pre>
  
  <p>which I want to test in a separate project like </p>
  
  <pre><code>[TestMethod]
  public void TwoNumbersDescendingAreSwapped()
  {
       string input = "2 1";
       string expectedOutput = "1 2"; 
       // ... ???
       Assert.AreEqual(expectedOutput, actualOutput);
  }
  </code></pre>
  
  <p>Is it possible to do that without actually using the .exe from Solution?</p>