Click here to Skip to main content
Rate this: bad
good
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
Edited 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 at 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
0 Nirav Prabtani 384
1 OriginalGriff 289
2 Sergey Alexandrovich Kryukov 225
3 _Amy 195
4 Kumarbs 144
0 OriginalGriff 7,799
1 Sergey Alexandrovich Kryukov 6,966
2 Maciej Los 3,994
3 Peter Leow 3,708
4 CHill60 2,742


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 25 Jan 2013
Copyright © CodeProject, 1999-2014
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