Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hai.
I am doing unit test on a method "Fetch" which is an IList,i want to display the count in nunit frame work if the test passes or fails.Here am using Console.writeline method.Is there any other method for my requirement.

 [TestCase]
  public void FetchTest()
  {
      int count = 0;
      try
      {
          if (adminBusinessController != null)
          {
              count = adminBusinessController.Fetch().Count;
              Assert.GreaterOrEqual(count, 1);
              Console.WriteLine("count {0}",count);

           }
       }

       catch (Exception ex)
       {
           Assert.Fail(ex.Message + " " + ex.StackTrace);

       }
    }
Posted
Updated 25-Jan-13 1:43am
v2

1 solution

You could try
C#
MessageBox.Show("count " + countToString());
 
Share this answer
 
Comments
Anmerin 28-Jan-13 0:16am    
sorry i cant use messageBox.I need to display the value in Nunit frame work itself while testing...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900