/*Skeleton TestHarness class .cpp*/

#include "TestHarness.h"

/* Comment these in as you complete them */

//#include "InputPattern.h"
//#include "OutputPattern.h"
//#include "CSVFile.h"

TestHarness::TestHarness(void)
{	

}

TestHarness::~TestHarness(void)
{

}

bool TestHarness::testInputPatternCreate()
{
	/* Testing a constructor is a bit tricky, 
	 * so here's the code for the first one 
	 * there are better ways to test (try / catch)
         */

	bool testResult = false;

	//Set pointer to NULL (0)
	InputPattern* test = NULL;

	//Allocate
	test = new InputPattern();

	//Make sure its no longer null	
	if(test != NULL)
		testResult = true;

	delete test;
	return testResult;
}

bool TestHarness::testInputPatternSetup()
{
	/* Test the get/set methods here 
	 * remember you can't use == with float
	 * you'll need to check the difference is 
	 * less than 0.0001 (DELTA) */

	/* Create a new CSVFile object */

	/* Test get and set for r, g, b and t */

	/* delete the test object */

	/* return the test result */

}

bool TestHarness::testInputPatternCreateWithParamters()
{
	/* Create and test overloaded constructor works */
}

bool TestHarness::testInputPatternsDestroy()
{
	/* No memory allocated, difficult to tell if this has worked */
}

bool TestHarness::testInputPatternsPrint()
{
	/* Create an object, set values and print 
         * check will be on screen 
         */
}

bool TestHarness::testOutputPatternCreate()
{
	/* See notes for InputPattern tests above */
}

bool TestHarness::testOutputPatternSetup()
{
	/* See notes for InputPattern tests above */
}

bool TestHarness::testOutputPatternCreateWithParamters()
{
	/* See notes for InputPattern tests above */
}

bool TestHarness::testOutputPatternsDestroy()
{
	/* See notes for InputPattern tests above */
}

bool TestHarness::testOutputPatternsPrint()
{
	/* See notes for InputPattern tests above */
}


bool TestHarness::testCSVFileCreate()
{
	/* See notes for InputPattern tests above */
}

bool TestHarness::testCSVFileSetFilepath()
{
	/* Check that the filepath can be set and recovered 
         * take care when comparing strings 
         */
}	

bool TestHarness::testCSVFileAddGetInputPattern()
{
	/* Check that input patterns can be added 
	 * HINT: This may require an additional method 
	 */
}

bool TestHarness::testCSVFileAddGetOutputPattern()
{
	/* Check that output patterns can be added 
	 * HINT: This may require an additional method 
	 */
}

bool TestHarness::testCSVFileLoadFile()
{
	/* Can check this works by giving it a known file
         * loading it and looking at the content.  We can
         * also check the first pattern of each? 
         */
}

bool TestHarness::testCSVFileLoadedFlag()
{
	/* Can check this works by giving it a known file
         * loading it and looking at the content.  We can
         * also check the first pattern of each? Then check
	 * the file gives what we expect. Should also consider
         * a test for the file not loading (i.e. no filename 
         * and no existent file).  
         */
}

bool TestHarness::testCSVFilePrintMeta()
{
	/* Load a file, make sure the meta data is what we expect */
}

bool TestHarness::testCSVFilePrintPatterns()
{
	/* Load a file, make sure the patterns are what we expect */
}

bool TestHarness::testInputPattern()
{
	const int TEST_COUNT = 5;
	int testsComplete = 0;

	if(this->testInputPatternCreate() == true)
	{ 
		printf("InputPattern Create test PASSED \n");
		testsComplete++;
	}
	else
	{
		printf("Input Pattern Create test FAILED \n");
	}

	/* need add the other tests */

	if(testsComplete == TEST_COUNT)
		return true;
	else
		return false;
}

bool TestHarness::testOutputPattern()
{
	/* See above */
}

bool TestHarness::testCSVFile()
{
	/* See above */
}

int main(char* argc[], int argv)
{
	TestHarness *t = new TestHarness();

	t->testInputPattern();
	t->testOutputPattern();
	t->testCSVFile();

	return 0;
}
