Table of Contents

RDT00006: Expected error not on a test

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

'@ExpectedError annotates a procedure that is not a test.

'@ExpectedError names the run-time error a test passes by raising. It has a meaning on a test only, a procedure that '@TestMethod annotates. On any other procedure it does nothing.

It is reported at the annotation.

How it is raised

Situation Example Resolution
'@ExpectedError on a setup procedure. '@TestInitialize and '@ExpectedError VBR00013 above Public Sub Setup(). Move the annotation to the test that raises the error.
'@ExpectedError on a procedure with no test annotation. '@ExpectedError VBR00011 above Public Sub DividesByZero(). Add '@TestMethod above the procedure.

See also

  • RDT00007: Expected error is not a run-time error's code
  • RDT00008: Expected error handled by the test