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

Scenario object representing entire test. More...

#include <scenarioroot.h>

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

Classes

struct  Impl
 

Public Member Functions

 ScenarioRoot (const std::string &name_)
 Ctor. More...
 
virtual ~ScenarioRoot ()
 Dtor. More...
 
 ScenarioRoot (const ScenarioRoot &)=delete
 
ScenarioRootoperator= (const ScenarioRoot &)=delete
 
void setName (const std::string &name_)
 Set name of the scenario (the name of the entire test) More...
 
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 override
 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

Scenario object representing entire test.

Definition at line 30 of file scenarioroot.h.

Constructor & Destructor Documentation

◆ ScenarioRoot() [1/2]

OTest2::ScenarioRoot::ScenarioRoot ( const std::string &  name_)
explicit

Ctor.

Parameters
name_Name of the test

Definition at line 96 of file scenarioroot.cpp.

◆ ~ScenarioRoot()

OTest2::ScenarioRoot::~ScenarioRoot ( )
virtual

Dtor.

Definition at line 102 of file scenarioroot.cpp.

◆ ScenarioRoot() [2/2]

OTest2::ScenarioRoot::ScenarioRoot ( const ScenarioRoot )
delete

Member Function Documentation

◆ appendScenario()

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

Append new sub-scenario into the container.

Parameters
scenario_The appended scenario

Implements OTest2::ScenarioContainer.

Definition at line 150 of file scenarioroot.cpp.

◆ createRepeater()

std::pair< std::string, ObjectRepeaterPtr > OTest2::ScenarioRoot::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 124 of file scenarioroot.cpp.

◆ enterObject()

void OTest2::ScenarioRoot::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 129 of file scenarioroot.cpp.

◆ filterScenario()

ScenarioPtr OTest2::ScenarioRoot::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 112 of file scenarioroot.cpp.

◆ getChildren()

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

Get iterator of children object.

Implements OTest2::Scenario.

Definition at line 146 of file scenarioroot.cpp.

◆ isEmpty()

bool OTest2::ScenarioRoot::isEmpty ( ) const
overridevirtualnoexcept

Check whether the container is empty.

Implements OTest2::ScenarioContainer.

Definition at line 156 of file scenarioroot.cpp.

◆ leaveObject()

void OTest2::ScenarioRoot::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 137 of file scenarioroot.cpp.

◆ operator=()

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

◆ setName()

void OTest2::ScenarioRoot::setName ( const std::string &  name_)

Set name of the scenario (the name of the entire test)

Parameters
name_The name

Definition at line 106 of file scenarioroot.cpp.


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