OTest2
A C++ testing framework
caseordinary.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Ondrej Starek
3  *
4  * This file is part of OTest2.
5  *
6  * OTest2 is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License,
9  * or (at your option) any later version.
10  *
11  * OTest2 is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with OTest2. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef OTest2__INCLUDE_OTEST2_CASEORDINARY_H_
21 #define OTest2__INCLUDE_OTEST2_CASEORDINARY_H_
22 
23 #include <string>
24 
25 #include <otest2/case.h>
26 #include <otest2/caseordinaryptr.h>
27 #include <otest2/stateptr.h>
28 
29 namespace OTest2 {
30 
31 class Context;
32 
37 class CaseOrdinary : public Case {
38  public:
39  /* -- avoid copying */
41  const CaseOrdinary&) = delete;
43  const CaseOrdinary&) = delete;
44 
50  explicit CaseOrdinary(
51  const Context& context_);
52 
56  virtual ~CaseOrdinary();
57 
63  virtual StatePtr getFirstState() const = 0;
64 
71  virtual StatePtr getState(
72  const std::string& name_) const = 0;
73 };
74 
75 } /* namespace OTest2 */
76 
77 #endif /* OTest2__INCLUDE_OTEST2_CASEORDINARY_H_ */
caseordinaryptr.h
OTest2::CaseOrdinary::operator=
CaseOrdinary & operator=(const CaseOrdinary &)=delete
OTest2::CaseOrdinary::getFirstState
virtual StatePtr getFirstState() const =0
Get the initial state.
OTest2::CaseOrdinary::~CaseOrdinary
virtual ~CaseOrdinary()
Dtor.
Definition: caseordinary.cpp:29
OTest2::CaseOrdinary::getState
virtual StatePtr getState(const std::string &name_) const =0
Get state with specified name_.
OTest2::CaseOrdinary::CaseOrdinary
CaseOrdinary(const CaseOrdinary &)=delete
case.h
OTest2
Definition: assertbean.h:25
OTest2::StatePtr
std::shared_ptr< State > StatePtr
Pointer to test state objects.
Definition: stateptr.h:27
OTest2::CaseOrdinary
An ordinary case object scheduled by the CmdFirstState, CmdRunState and CmdState commands.
Definition: caseordinary.h:37
stateptr.h
OTest2::Context
OTest2 runtime context.
Definition: context.h:38
OTest2::Case
Interface of a test case.
Definition: case.h:30