Table of Contents

RDT00005: Several setup or cleanup procedures

Severity: Warning  ·  Family: RDT (RDCore.UnitTesting)  ·  Raised by: TestModuleAnalyzer

Two or more procedures of one module have the same setup or cleanup annotation: '@ModuleInitialize, '@ModuleCleanup, '@TestInitialize or '@TestCleanup.

A test module has at most one procedure of each: one that runs before its first test, one after its last test, one before each test and one after each test.

It is reported at each of the annotations.

How it is raised

Situation Example Resolution
Two '@ModuleInitialize procedures. '@ModuleInitialize above Public Sub OpenWorkbook(), and again above Public Sub LoadData(). Call one from the other, and keep the annotation on the one that calls.

See also