Identifies a Procedure as a unit test.
@Test [ IGNORE ]
- Optional identifier specifies that the unit test that follows is not always necessary.
You use the Modifier
@Test to write unit tests.
A unit test is a Procedure to do one test on a small block of code.
The code (typically methods and other Procedures) all must be correct.
If you write the identifier
@Test, the related unit test is usually ignored.
Usually you do this for tests that run for a very long time.
But if you supply the command line switch TBD, such tests will be included.
The Procedure usually uses the object method
#Debug.Assert() to do its test.
- The Procedure must not have parameters.
- The Procedure must not have a return type.
Class Adder method Add(a As Int32, b As Int32) As Int32 Return a + b End End Class
@Test Sub Add1and1 New Adder obj #Debug.Assert obj.Add(1, 1) = 2 End @Test Sub AddNegatives New Adder obj #Debug.Assert obj.Add(-1, -1) = -2 End