How to test a VB.NET constructor?

C

Chris Leffer

Hi.

I am playing with the Test Projects of the Team Developer edition of
Visual Studio. When testing some functions, all is ok. But when I try to
test a constructor written in VB.NET, the test code is created with an
instruction:

Assert.Inconclusive("A method that does not return a value cannot be
verified.")

What does it mean? Can't I test Subs? I would like to test this
constructor since it receives some parameters and there are validations
in place for them.

TIA,
Chris Leffer
 
S

sloan

What are you going to test on a sub?

Assert ( Nothing.IsEqual(Nothing) ) ?

You can expose properties on the object, and check those post construction.

I think you can check if it blows up or not (aka, if you send bad data in,
and it blows up).

...

But your yearning to test a sub/void method doesn't really make sense.


Since it returns (nothing), you can't compare it to anything meaningful.

I think the error message is pretty much on the mark.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top