(**
* These unit tests are from a project I inherited. Look how /incredibly/
* useful they are! I'm very glad this developer is no longer working with us.
*)
unit BPMTestCases;
interface
uses Sysutils, // Format Command
Forms,
TestFramework;
Type
TJobs = class(TTestCase)
Private
pathscript : String;
protected
procedure SetUp; override;
procedure TearDown; override;
published
procedure CreateDatabase;
procedure InsertJobs;
procedure InsertJobsItems;
end;
TJobsHandSheets = class(TTestCase)
Private
pathscript : String;
published
procedure InsertErectJobsHandOverSheets;
procedure DismantleErectJobsHandOverSheets;
procedure InsertErectJobsHandOverSheetsH;
procedure DismantleErectJobsHandOverSheetsH;
end;
function UnitTests: ITestSuite;
implementation
{ TTestCaseFirst }
uses uGeneral;
procedure TJobs.CreateDatabase;
begin
pathscript := 'PPSTest.bat';
ExecNewProcess(pathscript,true);
end;
procedure TJobs.InsertJobs;
begin
//
pathscript := 'PPSTest_InsertJobs.bat';
ExecNewProcess(pathscript,true);
end;
procedure TJobs.InsertJobsItems;
begin
// Go Ahead Insert Jobs
pathscript := 'PPSTest_InsertJobsItems.bat';
ExecNewProcess(pathscript,true);
end;
procedure TJobs.SetUp;
begin
// Extract Database
//pathscript := Format('mysql -uroot -proot ppstest < %s ',[ExtractFilePath(Application.ExeName) + 'PPSTest.sql']);
end;
procedure TJobs.TearDown;
begin
// Free Objects
end;
function UnitTests: ITestSuite;
var
ATestSuite: TTestSuite;
begin
ATestSuite := TTestSuite.create('Hand Over Sheets');
ATestSuite.addTest(TJobs.Suite);
ATestSuite.addTest(TJobsHandSheets.Suite);
Result := ATestSuite;
end;
{ TJobsHandSheets }
procedure TJobsHandSheets.DismantleErectJobsHandOverSheets;
begin
// Go Ahead Insert Jobs
pathscript := 'PPSTest_DismantleJobsHandOverSheets.bat';
ExecNewProcess(pathscript,true);
end;
procedure TJobsHandSheets.DismantleErectJobsHandOverSheetsH;
begin
pathscript := 'PPSTest_DismantleJobsHandOverSheetsH.bat';
ExecNewProcess(pathscript,true);
end;
procedure TJobsHandSheets.InsertErectJobsHandOverSheets;
begin
// Go Ahead Insert Jobs
pathscript := 'PPSTest_InsertJobsHandOverSheets.bat';
ExecNewProcess(pathscript,true);
end;
procedure TJobsHandSheets.InsertErectJobsHandOverSheetsH;
begin
pathscript := 'PPSTest_InsertJobsHandOverSheetsH.bat';
ExecNewProcess(pathscript,true);
end;
Initialization
RegisterTest('BPM Test Harness', UnitTests);
end.