Click here to Skip to main content
12,405,088 members (67,127 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# NUnit
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 25-Jan-13 1:25am
Anmerin317
Updated 25-Jan-13 1:43am
v2

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

You could try
MessageBox.Show("count " + countToString());
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 25 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100