-
Notifications
You must be signed in to change notification settings - Fork 4
How‐to: AccUnit Attributes
Marks a class as a test class.
' AccUnit:TestClass
- Declaration scope of a class
Marks a class, standard module or forms/reports as utility modules for tests. These code modules or forms/reports can be imported or exported in the same way as test classes.
' AccUnit:TestRelated
- Declaration scope of a class (also class of form, report)
- Declaration scope of a module
Setting the row test parameters
' AccUnit:Row(Param1, Param2)
- Declaration scope of a test procedure
Public Function GetFoo(ByVal JaNein As String) As Boolean
GetFoo = False
If JaNein = "Ja" Then GetFoo = True
End Function
'AccUnit:Row("Ja", True)
'AccUnit:Row("Nein", False)
Public Sub GetFoo_ValueTest(ByVal value As String, ByVal Expected As Boolean)
Assert.That GetFoo(value), Iz.EqualTo(Expected)
End Sub
Marks test classes. Can be used to filter the tests.
' AccUnit:TestClass:Tags(Tag1, Tag2, Tag3)
- Declaration scope of a test class
Marks test methods. Can be used to filter the tests.
' AccUnit:Tags(Tag1, Tag2, Tag3)
- Declaration scope of a test procedure
- Tags at method level are automatically displayed at the level of the respective test class when the test results are displayed.
Do not run test class or method.
' AccUnit:Ignore
' AccUnit:Ignore(Comment)
' AccUnit:Row(Param1, Param2).Ignore(Comment)
- Declaration scope of a test class
- Declaration scope of a test procedure
- Extension of the Row attribute
Mouse clicks for Msgbox replacement function
' AccUnit:ClickingMsgBox(vbYes, vbOk, vbNo)
' AccUnit:Row(Param1, Param2).ClickingMsgBox(vbYes, vbOk, vbNo))
- Declaration scope of a test procedure
- Extension of the Row attribute
Creates a transaction on the standard Jet workspace (DAO) before each run of the test method and rolls this transaction back after the test method has been run.
' AccUnit:Rollback
- Declaration scope of a test procedure
- Built-in domain aggregate functions (DLookup, DCount, etc.) -> use substitute functions
- Code that uses transactions itself.
- Server backends integrated via OleDb (SQL server & Co.)
The rollback does not reset the counter for AutoValue columns. After an insert has been rolled back, the AutoValue assigned is no longer available.