NUnit???

  • Thread starter Thread starter Frank Rizzo
  • Start date Start date
F

Frank Rizzo

I am trying to figure out NUnit. I've seen some blogs where people
swear by it. I can't figure it out. What is its purpose? And I am not
sure how to make it work once it is installed.

I clicked on Test With/VS.NET and it always returns

TestCase 'M:AppProject.Mru.Add(System.String)' failed: Parameter count
mismatch.

regardless of the class I try to test with.

Is there a good tutorial somewhere on this?

Thanks
 
Here is a quick tutorial on using it in C#. I could not find one with a
quick look using VB but it is similar.

http://www.parlezuml.com/tutorials/tdd_nunit/index_files/frame.htm

I see TDD (Test Driven Development) as a good and positive thing but it can
add a bit of bloat to your projects because the test are compiled as part of
the assembly. NUnit runs the tests by using reflection so the test cases are
actually part of your code.

Just view the test cases as if you were writing a test bed application to
make use of your class. You write test cases that create instances of your
objects, set values, perform processing, and look at the results to check
them against what you know they should be. NUnit just automates this process
for you and runs the tests that you design automated so you don't have to do
it manually.

It really shines in two areas:

1) When you write the tests before you write your code. This helps
because it makes sure that you write your code according to how you plan to
use it. Tests should be written against the project specs, not really
against the code that resulted from the spec. Units testing allows you to
make sure that your end results works as you wanted it to.

2) When you have to make changes to code as time goes on. Unit tests help
you ensure that your changes in the future don't break tests that used to
work in the past. Each time you make a change and compile it you should
re-run your tests to ensure that the code still behaves as it did.
 
Back
Top