Skip to content
Permalink
master
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
/**
* Test.h
*
* Author: Jamey Calabrese
*
* Description: This is the unit test class header.
*
*/
#ifndef TEST_H
#define TEST_H
#include <iostream>
#include <vector>
class UnitTest
{
public:
UnitTest();
virtual ~UnitTest();
void TestIntro();
void TestConclusion();
bool Passed();
virtual void PerformTest() = 0;
protected:
void Fail();
void AssertTrue(bool expression);
void AssertFalse(bool expression);
template<class T>
void AssertEquals(T a, T b) { if (a != b) { Fail(); } }
std::string testName;
private:
bool passed;
};
class ComponentTest
{
public:
ComponentTest();
virtual ~ComponentTest();
void PrintIntro();
void PrintConclusion();
bool TestComponent();
unsigned long long GetTestCount();
unsigned long long GetTestsFailed();
unsigned long long GetTestsPassed();
protected:
std::vector<UnitTest*> tests;
unsigned long long run;
unsigned long long failed;
unsigned long long passed;
std::string testName;
};
#endif /* TEST_H */