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

Common implementation of a generated test case. More...

#include <casegenerated.h>

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

Classes

struct  Impl
 

Public Member Functions

 CaseGenerated (const CaseGenerated &)=delete
 
CaseGeneratedoperator= (const CaseGenerated &)=delete
 
 CaseGenerated (const Context &context_, const std::string &name_)
 Ctor. More...
 
virtual ~CaseGenerated ()
 Dtor. More...
 
virtual std::string getName () const
 Get object's name. More...
 
virtual bool startUpObject (const Context &context_, int index_) override
 Execute start-up function at specified index. More...
 
virtual void scheduleBody (const Context &context_, ScenarioPtr scenario_, ObjectPtr me_) override
 Schedule body of the testing object. More...
 
virtual void tearDownObject (const Context &context_, int index_) override
 Execute tear-down function at specified index. More...
 
virtual StatePtr getFirstState () const override
 Get the initial state. More...
 
virtual StatePtr getState (const std::string &name_) const override
 Get state with specified name_. More...
 
virtual const Contextotest2Context () const
 Get the OTest2 context. More...
 
- Public Member Functions inherited from OTest2::CaseOrdinary
 CaseOrdinary (const CaseOrdinary &)=delete
 
CaseOrdinaryoperator= (const CaseOrdinary &)=delete
 
 CaseOrdinary (const Context &context_)
 Ctor. More...
 
virtual ~CaseOrdinary ()
 Dtor. More...
 
- Public Member Functions inherited from OTest2::Case
 Case ()
 Ctor. More...
 
virtual ~Case ()
 Dtor. More...
 
 Case (const Case &)=delete
 
Caseoperator= (const Case &)=delete
 
- Public Member Functions inherited from OTest2::ObjectScenario
 ObjectScenario ()
 Dtor. More...
 
virtual ~ObjectScenario ()
 Dtor. More...
 
 ObjectScenario (const ObjectScenario &)=delete
 
ObjectScenariooperator= (const ObjectScenario &)=delete
 
- Public Member Functions inherited from OTest2::Object
 Object (const Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object ()
 Ctor. More...
 
virtual ~Object ()
 Dtor. More...
 
- Public Member Functions inherited from OTest2::ContextObject
 ContextObject (const ContextObject &)=delete
 
ContextObjectoperator= (const ContextObject &)=delete
 
 ContextObject ()
 Ctor. More...
 
virtual ~ContextObject ()
 Dtor. More...
 

Protected Member Functions

void registerState (const std::string &name_, StatePtr state_)
 Register new test state. More...
 
void setEnteringState (const std::string &name_)
 Set name of the entering (first) state. More...
 
void registerFixture (FceMarshalerPtr start_up_, FceMarshalerPtr tear_down_)
 Register a pair of start-up and tear-down functions. More...
 

Detailed Description

Common implementation of a generated test case.

Definition at line 37 of file casegenerated.h.

Constructor & Destructor Documentation

◆ CaseGenerated() [1/2]

OTest2::CaseGenerated::CaseGenerated ( const CaseGenerated )
delete

◆ CaseGenerated() [2/2]

OTest2::CaseGenerated::CaseGenerated ( const Context context_,
const std::string &  name_ 
)
explicit

Ctor.

Parameters
context_OTest2 context
name_Name of the test case

Definition at line 80 of file casegenerated.cpp.

◆ ~CaseGenerated()

OTest2::CaseGenerated::~CaseGenerated ( )
virtual

Dtor.

Definition at line 88 of file casegenerated.cpp.

Member Function Documentation

◆ getFirstState()

StatePtr OTest2::CaseGenerated::getFirstState ( ) const
overridevirtual

Get the initial state.

Returns
The state or nullptr if the case doesn't contain any one.

Implements OTest2::CaseOrdinary.

Definition at line 130 of file casegenerated.cpp.

◆ getName()

std::string OTest2::CaseGenerated::getName ( ) const
virtual

Get object's name.

Implements OTest2::Object.

Definition at line 92 of file casegenerated.cpp.

◆ getState()

StatePtr OTest2::CaseGenerated::getState ( const std::string &  name_) const
overridevirtual

Get state with specified name_.

Parameters
name_Name of the state
Returns
The state or null pointer

Implements OTest2::CaseOrdinary.

Definition at line 134 of file casegenerated.cpp.

◆ operator=()

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

◆ otest2Context()

const Context & OTest2::CaseGenerated::otest2Context ( ) const
virtual

Get the OTest2 context.

Implements OTest2::ContextObject.

Definition at line 139 of file casegenerated.cpp.

◆ registerFixture()

void OTest2::CaseGenerated::registerFixture ( FceMarshalerPtr  start_up_,
FceMarshalerPtr  tear_down_ 
)
protected

Register a pair of start-up and tear-down functions.

Definition at line 154 of file casegenerated.cpp.

◆ registerState()

void OTest2::CaseGenerated::registerState ( const std::string &  name_,
StatePtr  state_ 
)
protected

Register new test state.

Parameters
name_Name of the state
state_The state

Definition at line 143 of file casegenerated.cpp.

◆ scheduleBody()

void OTest2::CaseGenerated::scheduleBody ( const Context context_,
ScenarioPtr  scenario_,
ObjectPtr  me_ 
)
overridevirtual

Schedule body of the testing object.

Parameters
context_The OTest2 context
scenario_The scenario representing this object
me_A shared pointer pointing this instance

Implements OTest2::ObjectScenario.

Definition at line 109 of file casegenerated.cpp.

◆ setEnteringState()

void OTest2::CaseGenerated::setEnteringState ( const std::string &  name_)
protected

Set name of the entering (first) state.

Parameters
name_The name

Definition at line 149 of file casegenerated.cpp.

◆ startUpObject()

bool OTest2::CaseGenerated::startUpObject ( const Context context_,
int  index_ 
)
overridevirtual

Execute start-up function at specified index.

Parameters
context_The OTest2 context
index_The zero based index of the start-up function
Returns
True if the start-up function exists and has been run

Implements OTest2::ObjectScenario.

Definition at line 96 of file casegenerated.cpp.

◆ tearDownObject()

void OTest2::CaseGenerated::tearDownObject ( const Context context_,
int  index_ 
)
overridevirtual

Execute tear-down function at specified index.

Parameters
context_The OTest2 context
index_The zero based index of the tear-down function

Implements OTest2::ObjectScenario.

Definition at line 120 of file casegenerated.cpp.


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