Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / March 2008

Tip: Looking for answers? Try searching our database.

How to test a VB.NET constructor?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris Leffer - 27 Mar 2008 13:34 GMT
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
sloan - 28 Mar 2008 02:22 GMT
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.

> Hi.
>
[quoted text clipped - 14 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.