Ambrosian Scripture

Real-world answers to real-world problems.

Testing Testing

I recently had the opportunity to play around a bit with NUnit.  I am by no means an expert on Test-Driven Development (TDD), and in fact I've only just read a book under that title by Beck.  So take my comments with that in mind.  NUnit is fairly easy to use, and I do think it applies the TDD concepts well.  I only tested a bit and am sure only touched the tip of what I could do, but one thing that jumped out immediately was that I thought that Debug.Writeline should write out to the NUnit output console.  I couldn't readily see a way to write out any tracing in the VS.NET Add-in, but I found I could use Console.WriteLine for the WinForms app.  I tend to think that for most of us, console apps are not our forte, so using Debug.WriteLine would be more helpful, or maybe even NUnit.WriteLine--something that would be ignored during normal execution.

All in all, it looks promising for unit testing, which I plan on using with new development.

Posted: Jan 06 2004, 04:47 PM by Ambrose | with 3 comment(s)
Filed under:

Comments

Omar Shahine said:

# January 7, 2004 12:26 AM

MG2 said:

geez, the hawks circle fast.

Use Command.WriteLine, you'll be just fine.
# January 7, 2004 8:25 AM

Jamie Cansdale said:

Try this in NUnitAddIn...

UnitAddIn Installer
http://sourceforge.net/project/showfiles.php?group_id=64706

private static void Test()
{
Debug.WriteLine("Hello, World!");
}

Right click inside the method and 'Run Test(s)'. This will execute the method you're on and display the output. You can use NUnit or jUnit if you want want to run multiple tests (in a class, project or solution). You can also opt to run with debugger or different .NET runtime versions.

Have fun, Jamie.
# January 7, 2004 6:03 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)