Are there any good TDD tools or resources for VB6?

后端 未结 3 1387
忘了有多久
忘了有多久 2020-12-01 08:23

Yea i know i\'m way behind times but what i\'ve got here is a antique VB6 editor app which i believe that no one will be upgrading to .NET soon. It uses a couple of third pa

3条回答
  •  庸人自扰
    2020-12-01 09:15

    I've had very smooth TDD experience using SimplyVBUnit. I thought the sample the code comes with was pretty self-explanatory.

    Your initially loaded form at start-up contains the control. Then in the Form_Load sub you:

     AddTest New TestDifferentAsserts
    

    The TestDifferentAsserts is a vb class. It looks something like this:

    Public Sub TestFloatCompareTolerance()
       ' we will use the default tolerance of 0.00001
       Assert.AreEqual 9#, 9.000001, "Should be equal!"
    
       ' The Expected value must be a Double or Single
       ' for the tolerance to be used in the comparison.
       Assert.AreEqual 9, 9.000001, "This will fail because we didn't use a float for the expected value."
    End Sub
    

    In fact tomorrow I'm reloading vb6 on my computer to hack around on my computer with simplyvbunit.

    [ADDED EDIT]

    This is my project Explorer in VB6:

    project explorer

    Form1 is where the simplyvbunit control is located.

    The source code for this project.

    If you have third party controls, who cares. Wrap them with a facade. Then create a stub from the facade.

    If you need further help, leave a comment.

提交回复
热议问题