mgdatetst.cpp

#include <iostream.h>

#include "mgdate.h"

char TestDate[]="1/1/1999";

void main()
{
	MGDate A, B, C;

	cout << "Testing Output function: ";
	A.Output();
	cout << endl;

	cout << "Testing bad month setting: ";
	if( A.SetMonth( 53 ) )
		cout << "Something went wrong " << endl;
	else
		cout << "Tested ok." << endl;

	cout << "Testing bad day setting: ";
	if( A.SetDay( 53 ) )
		cout << "Something went wrong " << endl;
	else
		cout << "Tested ok." << endl;

	cout << "Testing bad month setting: ";
	if( A.SetYear( -6 ) )
		cout << "Something went wrong " << endl;
	else
		cout << "Tested ok." << endl;

	cout << "Testing good date setting: ";
	if( A.SetMonth( 11 ) )
		cout << "Tested ok." << endl;
	else
		cout << "Something went wrong " << endl;

	cout << "Testing date set from string: ";
	if( A.Set( TestDate ) )
		cout << "Tested ok." << endl;
	else
		cout << "Something went wrong " << endl;

	A.SetMonth(1);

	cout << "Testing GetMonth: ";
	if( A.GetMonth() == 1 )
		cout << "Tested ok." << endl;
	else
		cout << "Something went wrong " << endl;


}