For Programmers: Free Programming Magazines  


Home > Archive > Extreme Programming > July 2007 > testing ordinary methods using NUnit









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author testing ordinary methods using NUnit
raju

2007-06-27, 10:01 pm

Hai,

I am new to NUnit.

Using NUnit, I can test a method, which return value is correct
or not.

But, how to test, a method parameter type and a method process,
that doesn't return any value.

Regards,
Raj

A. W. Dunstan

2007-07-09, 7:02 pm

raju wrote:

> Hai,
>
> I am new to NUnit.
>
> Using NUnit, I can test a method, which return value is correct
> or not.
>
> But, how to test, a method parameter type and a method process,
> that doesn't return any value.
>
> Regards,
> Raj


I've not used NUnit (I use JUnit & CxxTest) but in general, when it comes to
unit testing a method that doesn't return a value:

Does it modify any of the parameters you passed it? Make sure they were
modified as expected.

Does it have some other side effect? create a file, write to a pipe, set a
flag, something like that? Make sure that side effect happened.

If it doesn't do either of those, then it sounds like it doesn't do much of
anything.

--
Al Dunstan, Software Engineer
OptiMetrics, Inc.
3115 Professional Drive
Ann Arbor, MI 48104-5131
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com