Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Enterprise
Expertise: All
Jul 7, 2000



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Simple Component Testing

When creating ActiveX components, an easy way to test them is to add a module to the project (see the code below). In this module you can write methods that will instantiate your component and then call the methods.

To make sure nothing was broken, you can keep your unit testing code with the project and call these functions when you have to edit your code.

 Public Sub TestAddition()
Dim oAdd As cAddition
Set oAdd = New cAddition
'if the result is not 8 then something is not 
working correctly Debug.Assert oAdd.AddNumbers(5, 3) = 8 Set oAdd = Nothing End Sub
Now all you have to do is type TestAddition in the Immediate window.
David A.
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date