Vb Unit Wish List

Here are some random thoughts on things that could be done to make VbUnitThree just a little easier or more convenient.

None of these are "requirements" in the conventional sense.

But should one find any more "irresponsible features" creeping around on the floor during idle time, maybe some of these could creep right in there. ;->


The pop up menu in the Add-In window does not pop up when you press the 'Menu' key (That odd key next to the the 'Window' key on the right hand side down by the space bar).

Instead, you get the customize menu pop up menu. It looks like VBUnit is not trapping the 'Menu key' and it's falling thru to the VB IDE.


Can we have the RunVBUnit syntax display in the console as we execute RunVBUnit without parameters or with "/?" or "/h"?

Try RunVBUnit -h


How about a FilesEqual? method, yes you can call assert.verify on a function that returns boolean, but it can go wrong and you have to think about file existence and so on. Possible options could be to ignore spaces. If someone wants to flatter me a bit, I could do it and let bodo include it in the next release -- AndyMorris

How about something like this:

 Private Function LoadFileToString(sFileName As String) As String
 On Error GoTo LoadFileErr

Dim nFile As Long Dim lFLen As Long nFile = FreeFile Open sFileName For Input As #nFile

lFLen = LOF(nFile) LoadFileToString = Input(lFLen, #nFile) Close #nFile

Exit Function LoadFileErr: LoadFileToString = "" End Function

Public Sub TestFilesEqual m_assert.StringsEqual LoadFileToString("file1.txt"), LoadFileToString("file2.txt"), "cmpFiles" End Sub
-- BodoMaass

Did that first time, on the second time you end up breaking OAOO or have to have it in a support library.

Also, you have to be careful about the size of the strings you end up comparing; it's much quicker to compare a big file in medium sized chunks.

Possibly true if you use FileSystemObject?. With the methods used above, file size should only be a concern if the files don't fit into your machine's main memory, so that probably means several tens of megabytes.

Is it FileSystemObject or is it long strings?

Anyway, I was bored so I've gone and done it. I'll send you the source; see what you think. -- AndyMorris

Alternately, one could write a function that reads lines from both files, and does m_Assert.StringsEqual on each line by itself. Also, when you reach end of file on either file, display an error message, and possibly the lines remaining in the other file.

I just added some comments on TipsOnUsingVbUnit that there's nothing wrong with building your own support library for test projects. I currently have hundreds (maybe thousands) of lines of reusable code -- reused across test fixtures. If I ever get the projects organized sensibly, I'll probably make a library of reusable test code -- much of it is specific to this application and our current design style.

-- JeffGrigg


EditText of this page (last edited April 25, 2014) or FindPage with title or text search