OTest2
A C++ testing framework
Public Member Functions | List of all members
OTest2::Scenario Class Referenceabstract

Generic scenario object. More...

#include <scenario.h>

Inheritance diagram for OTest2::Scenario:
Inheritance graph
[legend]

Public Member Functions

 Scenario ()
 Ctor. More...
 
virtual ~Scenario ()
 Dtor. More...
 
 Scenario (const Scenario &)=delete
 
Scenariooperator= (const Scenario &)=delete
 
virtual ScenarioPtr filterScenario (TagsStack &tags_, ScenarioContainerPtr parent_, const RunnerFilter &filter_) const =0
 Filter the scenario. More...
 
virtual std::pair< std::string, ObjectRepeaterPtrcreateRepeater (const Context &context_) const =0
 Create repeater object for testing object represented by this scenario object. More...
 
virtual void enterObject (const Context &context_) const noexcept=0
 Enter the testing object. More...
 
virtual void leaveObject (const Context &context_) const noexcept=0
 Report leaving of the testing object. More...
 
virtual ScenarioIterPtr getChildren () const =0
 Get iterator of children object. More...
 

Detailed Description

Generic scenario object.

The scenario is responsible for scheduling of test runs. Generally, it works as a kind of registry of suites and test cases. The scenario can be filtered by tags or object names. The test run then follows data in the scenario object.

Definition at line 47 of file scenario.h.

Constructor & Destructor Documentation

◆ Scenario() [1/2]

OTest2::Scenario::Scenario ( )

Ctor.

Definition at line 23 of file scenario.cpp.

◆ ~Scenario()

OTest2::Scenario::~Scenario ( )
virtual

Dtor.

Definition at line 27 of file scenario.cpp.

◆ Scenario() [2/2]

OTest2::Scenario::Scenario ( const Scenario )
delete

Member Function Documentation

◆ createRepeater()

virtual std::pair<std::string, ObjectRepeaterPtr> OTest2::Scenario::createRepeater ( const Context context_) const
pure virtual

Create repeater object for testing object represented by this scenario object.

Parameters
[in]context_The OTest2 context
[out]object_name_Name of the testing object
Returns
The name of the testing object and its repeater

Implemented in OTest2::ScenarioCase, OTest2::ScenarioSuite, and OTest2::ScenarioRoot.

◆ enterObject()

virtual void OTest2::Scenario::enterObject ( const Context context_) const
pure virtualnoexcept

Enter the testing object.

This method is responsible for report of entering of the testing object. It may modify object's parameters and it must report the object into the reporter.

As constructor methods may throw an exception causing failure of the test, we report the entering into the object before actual creation of the object.

Parameters
context_The OTest2 context. Current object path is ready.

Implemented in OTest2::ScenarioCase, OTest2::ScenarioSuite, and OTest2::ScenarioRoot.

◆ filterScenario()

virtual ScenarioPtr OTest2::Scenario::filterScenario ( TagsStack tags_,
ScenarioContainerPtr  parent_,
const RunnerFilter filter_ 
) const
pure virtual

Filter the scenario.

This method filters the scenario object. Objects which don't match the filters are removed.

Parameters
tags_Stack of object names and tags
parent_Parent container
filter_Used filter
Returns
The parent_ object if it's not null. Otherwise the new container object.

Implemented in OTest2::ScenarioCase, OTest2::ScenarioSuite, and OTest2::ScenarioRoot.

◆ getChildren()

virtual ScenarioIterPtr OTest2::Scenario::getChildren ( ) const
pure virtual

Get iterator of children object.

Implemented in OTest2::ScenarioCase, OTest2::ScenarioSuite, and OTest2::ScenarioRoot.

◆ leaveObject()

virtual void OTest2::Scenario::leaveObject ( const Context context_) const
pure virtualnoexcept

Report leaving of the testing object.

Parameters
context_The OTest2 context. Current object path is still set.

Implemented in OTest2::ScenarioCase, OTest2::ScenarioSuite, and OTest2::ScenarioRoot.

◆ operator=()

Scenario& OTest2::Scenario::operator= ( const Scenario )
delete

The documentation for this class was generated from the following files: