ZeroErr
Loading...
Searching...
No Matches
zeroerr::TestCase Struct Reference

TestCase is a class that holds the test case information. There are several fields that are used to store the test case information. More...

#include <unittest.h>

Inheritance diagram for zeroerr::TestCase:
Collaboration diagram for zeroerr::TestCase:

Public Member Functions

bool operator< (const TestCase &rhs) const
 Compare the test cases.
 TestCase (zeroerr::String name, zeroerr::String file, unsigned line, std::vector< Decorator * > decorators)
 Construct a new Test Case object.
 TestCase (zeroerr::String name, zeroerr::String file, unsigned line, std::function< void(TestContext *)> func, std::vector< Decorator * > decorators)
 Construct a new Test Case object.

Public Attributes

zeroerr::String name
zeroerr::String file
unsigned line
std::function< void(TestContext *)> func
std::vector< TestCase * > subcases
std::vector< Decorator * > decorators

Detailed Description

TestCase is a class that holds the test case information. There are several fields that are used to store the test case information.

  • name : The name of the test case.
  • file : The file that the test case is defined.
  • line : The line that the test case is defined.
  • func : The function that will be run to test the test case.
  • subcases : The subcases that are defined in the test case.

Constructor & Destructor Documentation

◆ TestCase() [1/2]

zeroerr::TestCase::TestCase ( zeroerr::String name,
zeroerr::String file,
unsigned line,
std::vector< Decorator * > decorators )
inline

Construct a new Test Case object.

Parameters
nameThe name of the test case.
fileThe file that the test case is defined.
lineThe line that the test case is defined.

◆ TestCase() [2/2]

zeroerr::TestCase::TestCase ( zeroerr::String name,
zeroerr::String file,
unsigned line,
std::function< void(TestContext *)> func,
std::vector< Decorator * > decorators )
inline

Construct a new Test Case object.

Parameters
nameThe name of the test case.
fileThe file that the test case is defined.
lineThe line that the test case is defined.
funcThe function that will be run to test the test case.
decoratorsThe decorators that will be used to decorate the test case.

Member Function Documentation

◆ operator<()

bool zeroerr::TestCase::operator< ( const TestCase & rhs) const

Compare the test cases.

Parameters
rhsThe test case that will be compared.
Returns
true If the test case is less than the rhs, otherwise false.

Member Data Documentation

◆ decorators

std::vector<Decorator*> zeroerr::TestCase::decorators

◆ file

zeroerr::String zeroerr::TestCase::file

◆ func

std::function<void(TestContext*)> zeroerr::TestCase::func

◆ line

unsigned zeroerr::TestCase::line

◆ name

zeroerr::String zeroerr::TestCase::name

◆ subcases

std::vector<TestCase*> zeroerr::TestCase::subcases

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