unit TestCommonFunctions; { Delphi DUnit Test Case ---------------------- This unit contains a skeleton test case class generated by the Test Case Wizard. Modify the generated code to correctly setup and call the methods from the unit being tested. } interface uses TestFramework, CommonFunctions; type // Test methods for class TCommonFunctions TestTCommonFunctions = class(TTestCase) strict private FCommonFunctions: TCommonFunctions; public procedure SetUp; override; procedure TearDown; override; published procedure TestVerkorteDnaCode_Standaard; procedure TestVerkorteDnaCode_Leeg; procedure TestIsKaderdeurLocatie_Leeg; procedure TestIsKaderdeurLocatie_LAAAAA0; procedure TestIsKaderdeurLocatie_10k12t01; procedure TestIsKaderdeurLocatie_10K13T01; end; implementation procedure TestTCommonFunctions.SetUp; begin FCommonFunctions := TCommonFunctions.Create; end; procedure TestTCommonFunctions.TearDown; begin FCommonFunctions.Free; FCommonFunctions := nil; end; procedure TestTCommonFunctions.TestVerkorteDnaCode_Standaard; var ReturnValue: string; DnaCode: string; begin DnaCode := 'LAAAAA0'; ReturnValue := FCommonFunctions.VerkorteDnaCode(DnaCode); CheckEquals('AAAAA',ReturnValue); end; procedure TestTCommonFunctions.TestVerkorteDnaCode_Leeg; var ReturnValue: string; DnaCode: string; begin DnaCode := ''; ReturnValue := FCommonFunctions.VerkorteDnaCode(DnaCode); CheckEquals('',ReturnValue); end; procedure TestTCommonFunctions.TestIsKaderdeurLocatie_10k12t01; var ReturnValue: Boolean; GescandeInput: string; begin GescandeInput := '10k12t01'; ReturnValue := FCommonFunctions.IsKaderdeurLocatie(GescandeInput); CheckEquals(true,ReturnValue); end; procedure TestTCommonFunctions.TestIsKaderdeurLocatie_LAAAAA0; var ReturnValue: Boolean; GescandeInput: string; begin GescandeInput := 'LAAAAA0'; ReturnValue := FCommonFunctions.IsKaderdeurLocatie(GescandeInput); CheckEquals(false,ReturnValue); end; procedure TestTCommonFunctions.TestIsKaderdeurLocatie_10K13T01; var ReturnValue: Boolean; GescandeInput: string; begin GescandeInput := '10K13T01'; ReturnValue := FCommonFunctions.IsKaderdeurLocatie(GescandeInput); CheckEquals(true,ReturnValue); end; procedure TestTCommonFunctions.TestIsKaderdeurLocatie_Leeg; var ReturnValue: Boolean; GescandeInput: string; begin GescandeInput := ''; ReturnValue := FCommonFunctions.IsKaderdeurLocatie(GescandeInput); CheckEquals(false,ReturnValue); end; initialization // Register any test cases with the test runner RegisterTest(TestTCommonFunctions.Suite); end.