title: How do I apply unit testing to C# function which requires user input dynamically?
body: <p>The function below gets input from the user. I need to test this function using <code>Unit Testing</code>. Can anyone tell me how to test this kind of function which require user input dynamically. Thanks</p>
  
  <p>like <code>boundary value analysis</code> ...</p>
  
  <p><code>numberOfCommands</code> should be <code>(0 &lt;= n &lt;= 100)</code></p>
  
  <pre><code>public static int Get_Commands()
  {
      do
      {
          string noOfCommands = Console.ReadLine().Trim();
          numberOfCommands = int.Parse(noOfCommands);             
      }
      while (numberOfCommands &lt;= 0 || numberOfCommands &gt;= 100);  
  
      return numberOfCommands;
  }
  </code></pre>
  
  <p>Programmatically hint will be great help!</p>