Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
TEACHING-MATERIALS/resources/05_automated_test/01_unit/cpp/TestSuiteCxx.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
24 lines (21 sloc)
643 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TestSuiteCxx.h | |
// This file contains our Cxx Test Suite which is defining our tests for our code in Maths.cpp | |
#include <cxxtest/TestSuite.h> | |
#include "Maths.h" | |
class TestSuiteCxx : public CxxTest::TestSuite | |
{ | |
public: | |
void testAddition1(void) | |
{ | |
Maths myObject; | |
TS_ASSERT(myObject.add(1, 1) > 1); | |
TS_ASSERT_EQUALS(myObject.add(1, 1), 2); | |
} | |
void testAddition2(void) | |
{ | |
Maths myObject; | |
TS_TRACE("Starting addition2 test"); | |
TS_ASSERT_EQUALS(myObject.add(2, 2), 5); // this will fail our test because our test has errors | |
TS_TRACE("Finishing addition2 test"); | |
} | |
}; |