title: How can I use NUnit to test a method with out or ref parameters?
body: <p>If I have a function which accepts an out parameter and accepts an input form console -</p>
  
  <pre><code>public void Test(out int a)
  {
       a = Convert.ToInt16(Console.ReadLine());  
  }
  </code></pre>
  
  <p>How can I accept an input using Console.Readline() during NUnit test? How can I use NUnit to test this method?</p>
  
  <p>I tried using this code for my NUnit test case - </p>
  
  <pre><code>[TestCase]
  public void test()
  {
       int a = 0;   
       ClassAdd ad = new ClassAdd();
       ad.addition(out a);
  
       //a should be equal to the value I input through console.Readline()
       Assert.AreEqual(&lt;some value I input&gt;, a, "test");    
  }
  </code></pre>
  
  <p>how can I test a method which accepts an out parameter and also accepts an user input from Console?</p>