Steppable 0.0.1
A CAS project written from scratch in C++
Loading...
Searching...
No Matches
steppable::testing::TestCase Class Reference

Represents a test case for unit testing. More...

#include <testing.hpp>

Public Member Functions

 TestCase (std::string testCaseName)
 Constructs a new TestCase object with the given name.
 
void assertIsEqual (const std::string &a, const std::string &b)
 Asserts that two strings are equal.
 
void assertIsNotEqual (const std::string &a, const std::string &b)
 Asserts that two strings are not equal.
 
void assertIsEqual (int a, int b)
 Asserts that two integers are equal.
 
void assertIsNotEqual (int a, int b)
 Asserts that two integers are not equal.
 
void assertTrue (bool value)
 Asserts that a boolean value is true.
 
void assertFalse (bool value)
 Asserts that a boolean value is false.
 
void summarize () const
 Prints a summary of the test case, including the number of errors encountered.
 

Public Attributes

int errorCount = 0
 

Private Member Functions

void assert (bool condition, const std::string &conditionName)
 Asserts a given condition and logs the condition name if it fails.
 

Private Attributes

std::string testCaseName
 

Detailed Description

Represents a test case for unit testing.

Constructor & Destructor Documentation

◆ TestCase()

steppable::testing::TestCase::TestCase ( std::string testCaseName)
explicit

Constructs a new TestCase object with the given name.

Parameters
[in]testCaseNameThe name of the test case.

Member Function Documentation

◆ assert()

void steppable::testing::TestCase::assert ( bool condition,
const std::string & conditionName )
private

Asserts a given condition and logs the condition name if it fails.

Parameters
[in]conditionThe condition to be checked.
[in]conditionNameThe name of the condition.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ assertFalse()

void steppable::testing::TestCase::assertFalse ( bool value)

Asserts that a boolean value is false.

Parameters
[in]valueThe boolean value to be checked.
Here is the call graph for this function:

◆ assertIsEqual() [1/2]

void steppable::testing::TestCase::assertIsEqual ( const std::string & a,
const std::string & b )

Asserts that two strings are equal.

Parameters
[in]aThe first string.
[in]bThe second string.
Here is the call graph for this function:

◆ assertIsEqual() [2/2]

void steppable::testing::TestCase::assertIsEqual ( int a,
int b )

Asserts that two integers are equal.

Parameters
[in]aThe first integer.
[in]bThe second integer.
Here is the call graph for this function:

◆ assertIsNotEqual() [1/2]

void steppable::testing::TestCase::assertIsNotEqual ( const std::string & a,
const std::string & b )

Asserts that two strings are not equal.

Parameters
[in]aThe first string.
[in]bThe second string.
Here is the call graph for this function:

◆ assertIsNotEqual() [2/2]

void steppable::testing::TestCase::assertIsNotEqual ( int a,
int b )

Asserts that two integers are not equal.

Parameters
[in]aThe first integer.
[in]bThe second integer.
Here is the call graph for this function:

◆ assertTrue()

void steppable::testing::TestCase::assertTrue ( bool value)

Asserts that a boolean value is true.

Parameters
[in]valueThe boolean value to be checked.
Here is the call graph for this function:

◆ summarize()

void steppable::testing::TestCase::summarize ( ) const

Prints a summary of the test case, including the number of errors encountered.

Here is the call graph for this function:

Member Data Documentation

◆ errorCount

int steppable::testing::TestCase::errorCount = 0

◆ testCaseName

std::string steppable::testing::TestCase::testCaseName
private

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