Table of Contents

Class TestAnnotations

Namespace
RDCore.UnitTesting.Protocol
Assembly
RDCore.UnitTesting.Protocol.dll

The names of the comment annotations that make an RD-VBA standard module a test module, and its procedures its tests and their setup and cleanup.

public static class TestAnnotations
Inheritance
TestAnnotations
Inherited Members

Remarks

They are RD-VBA comment annotations (RD-VBAL §3.0.1.1): to MS-VBA they are comments. TestModule is a module annotation, written in the module's declarations section; the others are member annotations, written on the lines directly above a procedure. Names compare without regard to case, as RD-VBA names do.

Fields

ExpectedError

The member annotation of the run-time error a test passes by raising: '@ExpectedError VBR00013. Its argument is a run-time error's diagnostic code, whose digits are the error's number, or the error's number itself, as a number or a constant expression (vbObjectError + 513).

public const string ExpectedError = "ExpectedError"

Field Value

string

IgnoreTest

The member annotation that keeps a test from running: '@IgnoreTest. The test is found, and its outcome is Ignored.

public const string IgnoreTest = "IgnoreTest"

Field Value

string

ModuleCleanup

The member annotation of the Sub that runs once, after the last test of its module: '@ModuleCleanup.

public const string ModuleCleanup = "ModuleCleanup"

Field Value

string

ModuleInitialize

The member annotation of the Sub that runs once, before the first test of its module: '@ModuleInitialize.

public const string ModuleInitialize = "ModuleInitialize"

Field Value

string

TestCase

The member annotation of a row of arguments of a test that takes parameters: '@TestCase(1, "one"). The test runs once for each of its rows, each row with its own outcome.

public const string TestCase = "TestCase"

Field Value

string

TestCleanup

The member annotation of the Sub that runs after each test of its module, whatever the test's outcome: '@TestCleanup.

public const string TestCleanup = "TestCleanup"

Field Value

string

TestInitialize

The member annotation of the Sub that runs before each test of its module: '@TestInitialize.

public const string TestInitialize = "TestInitialize"

Field Value

string

TestMethod

The member annotation that makes a Sub of a test module a test: '@TestMethod("Category"). Its optional argument is the test's category.

public const string TestMethod = "TestMethod"

Field Value

string

TestModule

The module annotation that makes a standard module a test module: '@TestModule. Its tests run in a session of their own.

public const string TestModule = "TestModule"

Field Value

string