How to test a VB.NET constructor?

  • Thread starter Thread starter Chris Leffer
  • Start date Start date
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
 
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.
 
Back
Top