Support

Frequently Asked Questions

Product Questions
Q: Will there be a version of vbUnit3 for Visual Basic .NET ?

Testing Questions
Q: How can I save the test results to a file?
Q: How should I test private methods of my classes? It seems that I have to change them to be public or friend.
Q: How can I perform some initialization and cleanup before and after ALL tests have run?

Licensing Questions
Q: Will the source code for the vbUnit3 TestRunner be released?
Q: Will there be any royalties for using vbUnit?
Q: Shouldn't all the xUnit tools be free?
Q: What are the implications of the GNU Lesser General Public License?
Q: What is the status of the tests that I have written for vbUnit?
Q: Is it possible to upgrade to a higher license type, e.g. from a 5-user license to a site license?

Product Questions

Q: Will there be a version of vbUnit3 for Visual Basic .NET ?

No. Visual Basic .NET is so different from VB6 that there is no simple upgrade path for any non-trivial VB6 codebase. Also, there are already some excellent unit testing tools available for .NET, and you can find them at www.xprogramming.com.

top

 

Testing Questions

Q: How can I save the test results to a file?

A: In the vbUnit Add-In window, right-click on the result list to get the context menu and chose "Save". For a more systematic approach, you should use Export Modules.

top

 

Q: How should I test private methods of my classes? It seems that I have to change them to be public or friend.

A: You've just realized an important point of unit testing, which is the fact that testability is part of your design requirements and will force you to do certain things in a certain way. Usually this results in a much cleaner design.
I do not recommend testing private methods of an object, because it will increase the coupling between interface and implementation. If your tests know about private methods of your object, they know a lot about your specific implementation, and it will be much harder for you to change the implementation without changing all the tests. However, if there is absolutely no way around it, you do indeed need to make the methods under test to be Public or Friend to allow the test classes to see them.
A better way would be to create a new interface that is private to your test project and that exposes the internal details of a class. The class could then implement this interface to allow the test classes to see its details.
However, if your class is so complex that much of it that needs to be tested is private, you should consider refactoring this complexity into several smaller classes with public interfaces that expose the minimum of information necessary to connect each class to the rest of the world. These interfaces would then be a good place to run tests against.

top

 

Q: How can I perform some initialization and cleanup before and after ALL tests have run?

A: If you just need to do some global initialization, the easiest thing would be to put it in Sub Main. If you also need to do cleanup after the TestSuite, you could use the following code as an example of how to decorate a Meta-TestSuite that will contain all your normal TestSuites:
'CompareHexNumbers

Public Sub TestCompareHexNumbers
  m_assert.StringsEqual ToHex(number1), ToHex(number2), "cmpHexNum"
End Sub

Private Function ToHex(ByVal number As Long) As String
  ToHex = Right$("00000000" & Hex$(number&), 8)
End Function

top

 

Licensing Questions

Q: Will the source code for the vbUnit3 TestRunner be released?

A: No, there are currently no plans to release the source code of vbUnitAddIn.dll, vbUnitTestRunner.exe, and RunVBUnit.exe. If your organization doesn't allow you to use tools that are not Open Source (however, why are you using VB then?), you can use the vbUnit2 TestRunner, which is fully Open Source.

top

 

Q: Will there be any royalties for using vbUnit?

A: No, there won't be any royalties whatsoever. You can use, modify, and redistribute those parts of vbUnit that are available as Open Source according to the terms of the GNU Lesser General Public License. The vbUnit3 TestRunner is not Open Source and will be licensed for a small fee.

top

 

Q: Shouldn't all the xUnit tools be free?

A: If you are reading this, you are probably a professional software developer and earn your living by writing software and taking money for it. Therefore you should understand the need to charge some money for a product like vbUnit3, which has quite a lot of full-time work in it. Besides, you can use vbUnit3 Basic, which is completely free.
However, if you find vbUnit useful, please support it by registering it.

top

 

Q: What are the implications of the GNU Lesser General Public License?

A: In short, if you write a program based on the vbUnit3 framework that assumes some or all functions of the vbUnit3 framework and exposes them as a library, your program is a derived work that also needs to be released under the terms of the LGPL if you want to distribute it. However, if you write a program that merely uses the vbUnit3 framework as a library, and which is not in itself a library, then this work does not need to be released under the terms of the LGPL.
Please read the full license for all details.

top

 

Q: What is the status of the tests that I have written for vbUnit?

A: Any tests that you write for vbUnit are completely your own. You can redistribute or sell them in any form you like. They are completely unaffected by the licensing terms of vbUnit.

top

 

Q: Is it possible to upgrade to a higher license type, e.g. from a 5-user license to a site license?

A: Yes, this is possible. The price is generally the difference between these licenses plus five percent. If you would like to upgrade your license please contact sales@vbunit.com.

top