OTest2
A C++ testing framework
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
OTest2::ScenarioCase Class Reference

Scenario object of a test case. More...

#include <scenariocase.h>

Inheritance diagram for OTest2::ScenarioCase:
Inheritance graph
[legend]
Collaboration diagram for OTest2::ScenarioCase:
Collaboration graph
[legend]

Classes

struct  Impl
 

Public Member Functions

 ScenarioCase (const std::string &name_, const Tags &tags_, ObjectRepeaterFactoryPtr repeater_factory_)
 Ctor. More...
 
 ScenarioCase (const std::string &name_, const std::string &section_path_, const Tags &tags_, ObjectRepeaterFactoryPtr repeater_factory_)
 Ctor - instance with active test section. More...
 
virtual ~ScenarioCase ()
 Dtor. More...
 
 ScenarioCase (const ScenarioCase &)=delete
 
ScenarioCaseoperator= (const ScenarioCase &)=delete
 
virtual ScenarioPtr filterScenario (TagsStack &tags_, ScenarioContainerPtr parent_, const RunnerFilter &filter_) const override
 Filter the scenario. More...
 
virtual std::pair< std::string, ObjectRepeaterPtrcreateRepeater (const Context &context_) const override
 Create repeater object for testing object represented by this scenario object. More...
 
virtual void enterObject (const Context &context_) const noexcept override
 Enter the testing object. More...
 
virtual void leaveObject (const Context &context_) const noexcept override
 Report leaving of the testing object. More...
 
virtual ScenarioIterPtr getChildren () const override
 Get iterator of children object. More...
 
- Public Member Functions inherited from OTest2::Scenario
 Scenario ()
 Ctor. More...
 
virtual ~Scenario ()
 Dtor. More...
 
 Scenario (const Scenario &)=delete
 
Scenariooperator= (const Scenario &)=delete
 

Static Public Member Functions

static ScenarioCaseBuilder createBuilder (const std::string &name_, const Tags &tags_, ObjectRepeaterFactoryPtr repeater_factory_)
 Create builder of the scenario case. More...
 

Friends

class ScenarioCaseBuilder
 

Detailed Description

Scenario object of a test case.

Definition at line 34 of file scenariocase.h.

Constructor & Destructor Documentation

◆ ScenarioCase() [1/3]

OTest2::ScenarioCase::ScenarioCase ( const std::string &  name_,
const Tags tags_,
ObjectRepeaterFactoryPtr  repeater_factory_ 
)
explicit

Ctor.

Parameters
name_Name of the test case
tags_Tags assigned to the object
repeater_factoryA factory of repeater objects of the test case

Definition at line 121 of file scenariocase.cpp.

◆ ScenarioCase() [2/3]

OTest2::ScenarioCase::ScenarioCase ( const std::string &  name_,
const std::string &  section_path_,
const Tags tags_,
ObjectRepeaterFactoryPtr  repeater_factory_ 
)
explicit

Ctor - instance with active test section.

Parameters
name_Name of the test case
section_path_Path of the active section (relative to the case)
tags_Tags assigned to the object
repeater_factoryA factory of repeater objects of the test case

Definition at line 129 of file scenariocase.cpp.

◆ ~ScenarioCase()

OTest2::ScenarioCase::~ScenarioCase ( )
virtual

Dtor.

Definition at line 145 of file scenariocase.cpp.

◆ ScenarioCase() [3/3]

OTest2::ScenarioCase::ScenarioCase ( const ScenarioCase )
delete

Member Function Documentation

◆ createBuilder()

ScenarioCaseBuilder OTest2::ScenarioCase::createBuilder ( const std::string &  name_,
const Tags tags_,
ObjectRepeaterFactoryPtr  repeater_factory_ 
)
static

Create builder of the scenario case.

See also
ScenarioCase::ScenarioCase()

Definition at line 138 of file scenariocase.cpp.

◆ createRepeater()

std::pair< std::string, ObjectRepeaterPtr > OTest2::ScenarioCase::createRepeater ( const Context context_) const
overridevirtual

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

Implements OTest2::Scenario.

Definition at line 177 of file scenariocase.cpp.

◆ enterObject()

void OTest2::ScenarioCase::enterObject ( const Context context_) const
overridevirtualnoexcept

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.

Implements OTest2::Scenario.

Definition at line 182 of file scenariocase.cpp.

◆ filterScenario()

ScenarioPtr OTest2::ScenarioCase::filterScenario ( TagsStack tags_,
ScenarioContainerPtr  parent_,
const RunnerFilter filter_ 
) const
overridevirtual

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.

Implements OTest2::Scenario.

Definition at line 149 of file scenariocase.cpp.

◆ getChildren()

ScenarioIterPtr OTest2::ScenarioCase::getChildren ( ) const
overridevirtual

Get iterator of children object.

Implements OTest2::Scenario.

Definition at line 204 of file scenariocase.cpp.

◆ leaveObject()

void OTest2::ScenarioCase::leaveObject ( const Context context_) const
overridevirtualnoexcept

Report leaving of the testing object.

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

Implements OTest2::Scenario.

Definition at line 195 of file scenariocase.cpp.

◆ operator=()

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

Friends And Related Function Documentation

◆ ScenarioCaseBuilder

friend class ScenarioCaseBuilder
friend

Definition at line 38 of file scenariocase.h.


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