-
Notifications
You must be signed in to change notification settings - Fork 4
How‐to: Run tests with AccUnit‐Loader (Access add‐in)
After the AccUnit Factory module with AccUnitLoader (Access add-in) has been inserted into the application under test, different variants can be used to start the tests by calling TestSuite
inside immediate window or VBA code.
TestSuite.AddFromVBProject.Run
AccUnit searches in VBProject of current application for classes, which were marked with 'AccUnit:TestClass
as test class. In these classes all public methods are executed as test (exception: Setup and Teardown methods).
TestSuite.Add(new MyTestClass).Run
-
TestSuite.AddByClassName("MyTestClass").Run
In both variants, all tests (public methods) of the respective test class (TestFixture) are executed.
-
TestSuite.<Any Add Methode>.SelectTests(<Method name filter>).Run
-
TestSuite.AddByClassName("SqlToolsTests").SelectTests("DateToSqlText_*").Run
All tests of the SqlToolsTests test class whose name starts with DateToSqlText_ are executed.
-
TestSuite.AddFromVBProject.SelectTests("*UseText*,*UseValues*").Run
-
TestSuite.AddFromVBProject.SelectTests(Array("*UseText*","*UseValues*")).Run
All tests in all existing test classes that contain UseText or UseValues will be executed.
-
-
TestSuite.<Any Add Methode>.Filter(<FilterTags>).Run
- for the test class (TestFixture):
'AccUnit:TestClass:Tags("Tag name", "Tag2")
- for a test:
'AccUnit:Tags("Tag name")
- for a row test line:
'AccUnit:Row(<parameters>).Tags("Tag name", "Tag2", "Tag3")
-
TestSuite.AddByClassName("SqlToolsTests").Filter("Null as argument").Run
All tests from SqlToolsTests that have "Null as argument" set as tag will be executed.
-
TestSuite.AddByClassName("SqlToolsTests").Filter("Tag1,Tag2").Run
-
TestSuite.AddByClassName("SqlToolsTests").Filter(Array("Tag1", "Tag2")).Run
Tests containing Tag1 and Tag2 are executed.
- for the test class (TestFixture):
Start automated test run with AutomatedTestRun / AutomatedTestRunVCS
- Function AutomatedTestRun
- Call via Application.Run:
ReturnValue = Application.Run("{insert Add-in folder path here}\AccUnitLoader.AutomatedTestRun")
- Returns True if all tests success (or ignored)
- Returns Falls if one or more tests failed
- Call via Application.Run:
- Function AutomatedTestRunVCS (optimizes for msaccess-vcs add-in) (Video)
- Call via Application.Run:
ReturnValue = Application.Run("{insert Add-in folder path here}\AccUnitLoader.AutomatedTestRunVCS")
- Returns a string like "Success: 5 tests passed" or "Success: 1 of 5 tests ignored"
- Returns a string like "Failed: 3 of 45 tests failed"
- Output test results into VCS log file
- Call via Application.Run: