


TestSuiteĪ test suite groups tests together, runs test hooks for actions that should be run before and after tests, and is responsible for passing test results to reporters. If you're updating from Excel-TDD v1, follow these upgrade details. If you're starting from scratch with Excel, you can use vba-test-blank.xlsm.Add src/TestSuite.cls, src/TestCase.cls, add src/ImmediateReporter.cls to your project.Download the latest release (v2.0.0-beta.3).IsEqual Add( 1, 2, 3, 4 ), 10 End With End Function Public Function Add( ParamArray Values() As Variant ) As Double Dim i As Integer Add = 0 For i = LBound(Values) To UBound(Values) Add = Add + Values(i) Next i End Function ' Immediate Window: ' ' = Add = ' + should add two numbers ' + should add any number of numbers ' = PASS (2 of 2 passed) =įor details of the process of reaching this example, see the TDD Example Advanced Exampleįor an advanced example of what is possible with vba-test, check out the tests for VBA-Web Getting Started IsEqual Add(- 1, - 2 ), - 3 End With With AddTests.Test( "should add any number of numbers" ).

Function AddTests() As TestSuite Set AddTests = New TestSuite AddTests.Description = "Add" ' Report results to the Immediate Window ' (ctrl + g or View > Immediate Window) Dim Reporter As New ImmediateReporter Reporter.ListenTo AddTests With AddTests.Test( "should add two numbers" ).
