Monday, May 29, 2006

 

NUnit - A deficiency

NNnit is a great tool.

However, it has one deficiency. As far as I can tell, you cannot easily write data driven tests that appear in the results.

If I have a file, that contains test a value and a result, I can read the file line by line (or use xml). I can then test function f

The test is then


< Test() > _
Sub Test
for each line
assert.IsEqual(line.result, f(line.value))
next line
End Sub



The problem is that each line will not be tested. The test fails on the first failure.

At the same time, I only see one result in the output - test.

It would be better to have all lines appear as tests in the output.

Perhaps something like this.


< Dynamictest() > _
Sub Test()
for each line
StartTest("f(" + line.value + ")"
assert.IsEqual(line.result, f(line.value))
EndTest
next line
End Sub

Comments: Post a Comment





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]