SETestCase.h
1 /**************************************************************************************
2 Copyright 2015 Applied Research Associates, Inc.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the License
5 at:
6 http://www.apache.org/licenses/LICENSE-2.0
7 Unless required by applicable law or agreed to in writing, software distributed under
8 the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9 CONDITIONS OF ANY KIND, either express or implied. See the License for the
10 specific language governing permissions and limitations under the License.
11 **************************************************************************************/
12 
13 #pragma once
14 #include <biogears/cdm/properties/SEScalarTime.h>
15 #include <biogears/cdm/utils/testing/SETestErrorStatistics.h>
16 CDM_BIND_DECL(TestCase)
17 
18 namespace biogears {
19 class SETestSuite;
20 
21 class BIOGEARS_API SETestCase : public Loggable {
22  friend SETestSuite;
23 
24 protected:
25  SETestCase(Logger* logger);
26  SETestCase(const std::string& name, Logger* logger);
27 
28 public:
29  virtual ~SETestCase();
30 
31  virtual void Reset(); //reset values
32  virtual void Clear(); //clear memory
33 
34  bool Load(const CDM::TestCase& in);
35  std::unique_ptr<CDM::TestCase> Unload() const;
36 
37 protected:
38  void Unload(CDM::TestCase& data) const;
39 
40 public:
41  void SetName(const std::string& name);
42  std::string GetName() const;
43  const char* GetName_cStr() const;
44  SEScalarTime& GetDuration();
45  void AddFailure(std::stringstream& msg);
46  void AddFailure(const std::string& err);
47  const std::vector<std::string>& GetFailures();
48 
49  SETestErrorStatistics& CreateErrorStatistic();
50  const std::vector<SETestErrorStatistics*>& GetErrorStatistics() const;
51 
52 protected:
53  std::string m_Name;
55 
56  std::vector<std::string> m_Failure;
57  std::vector<SETestErrorStatistics*> m_CaseEqualsErrors;
58 };
59 }
SEScalarTime m_Duration
Definition: SETestCase.h:54
std::string m_Name
Definition: SETestCase.h:53
Definition: SETestErrorStatistics.h:29
Definition: Logger.h:27
friend SETestSuite
Definition: SETestCase.h:22
Definition: Logger.h:75
Definition: SEScalarTime.h:37
Definition: SETestCase.h:21
Class corresponding to the TestCase schema type.
Definition: TestReport.hxx:2226
std::vector< std::string > m_Failure
Definition: SETestCase.h:56
Definition: SEElectricalCircuit.h:18
std::vector< SETestErrorStatistics * > m_CaseEqualsErrors
Definition: SETestCase.h:57