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

A scenario object representing one test suite. More...

#include <scenariosuite.h>

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

Classes

struct  Impl
 

Public Member Functions

 ScenarioSuite (const std::string &name_, const Tags &tags_, ObjectRepeaterFactoryPtr repeater_factory_)
 Create scenario object of a test suite. More...
 
virtual ~ScenarioSuite ()
 Dtor. More...
 
 ScenarioSuite (const ScenarioSuite &)=delete
 
ScenarioSuiteoperator= (const ScenarioSuite &)=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...
 
virtual void appendScenario (ScenarioPtr scenario_) override
 Append new sub-scenario into the container. More...
 
virtual bool isEmpty () const noexcept
 Check whether the container is empty. More...
 
- Public Member Functions inherited from OTest2::ScenarioContainer
 ScenarioContainer ()
 Ctor. More...
 
virtual ~ScenarioContainer ()
 Dtor. More...
 
 ScenarioContainer (const ScenarioContainer &)=delete
 
ScenarioContaineroperator= (const ScenarioContainer &)=delete
 
- Public Member Functions inherited from OTest2::Scenario
 Scenario ()
 Ctor. More...
 
virtual ~Scenario ()
 Dtor. More...
 
 Scenario (const Scenario &)=delete
 
Scenariooperator= (const Scenario &)=delete
 

Detailed Description

A scenario object representing one test suite.

Definition at line 35 of file scenariosuite.h.

Constructor & Destructor Documentation

◆ ScenarioSuite() [1/2]

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

Create scenario object of a test suite.

Parameters
name_Name of the suite
tags_Tags assigned to the object
repeater_factory_Factory of the repeater objects of the suite

Definition at line 76 of file scenariosuite.cpp.

◆ ~ScenarioSuite()

OTest2::ScenarioSuite::~ScenarioSuite ( )
virtual

Dtor.

Definition at line 84 of file scenariosuite.cpp.

◆ ScenarioSuite() [2/2]

OTest2::ScenarioSuite::ScenarioSuite ( const ScenarioSuite )
delete

Member Function Documentation

◆ appendScenario()

void OTest2::ScenarioSuite::appendScenario ( ScenarioPtr  scenario_)
overridevirtual

Append new sub-scenario into the container.

Parameters
scenario_The appended scenario

Implements OTest2::ScenarioContainer.

Definition at line 139 of file scenariosuite.cpp.

◆ createRepeater()

std::pair< std::string, ObjectRepeaterPtr > OTest2::ScenarioSuite::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 113 of file scenariosuite.cpp.

◆ enterObject()

void OTest2::ScenarioSuite::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 118 of file scenariosuite.cpp.

◆ filterScenario()

ScenarioPtr OTest2::ScenarioSuite::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 88 of file scenariosuite.cpp.

◆ getChildren()

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

Get iterator of children object.

Implements OTest2::Scenario.

Definition at line 135 of file scenariosuite.cpp.

◆ isEmpty()

bool OTest2::ScenarioSuite::isEmpty ( ) const
virtualnoexcept

Check whether the container is empty.

Implements OTest2::ScenarioContainer.

Definition at line 145 of file scenariosuite.cpp.

◆ leaveObject()

void OTest2::ScenarioSuite::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 126 of file scenariosuite.cpp.

◆ operator=()

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

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