Test Case structure
Overview
Once you open your newly created test case you will find several tags present within the file. All of those tags are explained within this chapter. You will also find the details of the ITester
interface (engine and execution access).
ITester
ITester
The ITester
interface allows you to access the functionality of the engine. There are several way in each you can use the interface. Please refer to the Object References chapter for full details regarding the available options.
[TestCase(number)]
tag
[TestCase(number)]
tagThis tag "tells" the engine that the class is a test case. The number part represents the revision number of the test case.
Example 1: Test Case Revision 1 is represented as [TestCase(1)]
Example 2: Test Case Revision 7 is represented as [TestCase(7)]
Do not delete the Test Case
tag from the class. Otherwise the engine will not be able to recognize the class as Test Case.
[SetupTest]
tag
[SetupTest]
tagWithin this tag the test case instantiates the test model. The underlying method needs to return true
in order for the test case to work. If the method returns false
the test case will abort.
[PreconditionStep]
tag
[PreconditionStep]
tagWithin the method defined with this tag you specify the actions necessary to fulfill the preconditions. The action function needs to return true
in order for the PreconditionStep to pass. You can report that the step passes or fails as follows:
[TestStep]
tag
[TestStep]
tagWithin the method defined with this tag you specify the test step actions. The tag has additional attributes which define the steps number, test input and expected results.
Tag attributes:
Attribute
Type
Description
Mandatory
Example usage
sequence
int
Defines the step number
Yes
[TestStep(1)]
TestInput
string
Defines the test input
Yes
[TestStep(1,
TestInput = "Click on the LogIn button")]
ExpectedResult
string
Defined the steps Expected Results
No
[TestStep(1,
TestInput = "Click on the LogIn button",
ExpectedResults = "Login is not successfull")]
[CleanupStep]
tag
[CleanupStep]
tagWithin the method defined with this tag you specify the actions necessary to fulfill the cleanup step. The action function needs to return true
in order for the CleanupStep to pass. You can report that the step passes or fails as follows:
[TearDownTest]
tag
[TearDownTest]
tagWithin this tag the your tear down your test. The underlying method needs to return true
in order for the test case to work. If the method returns false
the test case will fail.
Last updated