Index: ProScan/Test/CommonFunctions.dcu =================================================================== diff -u Binary files differ Index: ProScan/Test/ProScanTests.res =================================================================== diff -u Binary files differ Index: ProScan/Test/ProScanTests.dpr =================================================================== diff -u --- ProScan/Test/ProScanTests.dpr (revision 0) +++ ProScan/Test/ProScanTests.dpr (revision 398) @@ -0,0 +1,27 @@ +program ProScanTests; +{ + + Delphi DUnit Test Project + ------------------------- + This project contains the DUnit test framework and the GUI/Console test runners. + Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options + to use the console test runner. Otherwise the GUI test runner will be used by + default. + +} + +{$IFDEF CONSOLE_TESTRUNNER} +{$APPTYPE CONSOLE} +{$ENDIF} + +uses + DUnitTestRunner, + TestCommonFunctions in 'TestCommonFunctions.pas', + CommonFunctions in '..\UI\CommonFunctions.pas'; + +{$R *.RES} + +begin + DUnitTestRunner.RunRegisteredTests; +end. + Index: ProScan/Test/ProScanTests.dproj.local =================================================================== diff -u --- ProScan/Test/ProScanTests.dproj.local (revision 0) +++ ProScan/Test/ProScanTests.dproj.local (revision 398) @@ -0,0 +1,7 @@ + + + + 2020/06/11 10:59:02.352,=E:\svn\Delphi\ProScan\Test\TestCommonFunctions.pas + 2020/06/11 10:59:02.460,=E:\svn\Delphi\ProScan\UI\CommonFunctions.pas + + Index: ProScan/Test/DUnitConsts.dcu =================================================================== diff -u Binary files differ Index: ProScan/Test/ProScanTests.dproj =================================================================== diff -u --- ProScan/Test/ProScanTests.dproj (revision 0) +++ ProScan/Test/ProScanTests.dproj (revision 398) @@ -0,0 +1,150 @@ + + + {B29689DE-526F-4F1B-AB7D-513F86FDDA61} + 13.4 + None + True + Debug + Win32 + 1 + Console + ProScanTests.dpr + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + $(BDS)\Source\DUnit\src;$(DCC_UnitSearchPath) + bindcompfmx;fmx;rtl;dbrtl;IndySystem;DbxClientDriver;bindcomp;inetdb;DBXInterBaseDriver;xmlrtl;DbxCommonDriver;IndyProtocols;DBXMySQLDriver;dbxcds;bindengine;soaprtl;CustomIPTransport;dsnap;fmxase;IndyCore;inet;fmxobj;inetdbxpress;fmxdae;IPIndyImpl;dbexpress;$(DCC_UsePackage) + System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) + _CONSOLE_TESTRUNNER;$(DCC_Define) + . + .\$(Platform)\$(Config) + false + false + false + false + false + + + vclimg;vclactnband;vcldb;vcldsnap;bindcompvcl;vclie;vcltouch;websnap;VclSmp;vcl;dsnapcon;vclx;webdsnap;$(DCC_UsePackage) + + + vcldbx;frx16;TeeDB;Rave100VCL;vclib;Tee;inetdbbde;svnui;ibxpress;vclimg;fmi;intrawebdb_120_160;frxDB16;fs16;TeeUI;FMXTee;vclactnband;vcldb;vcldsnap;bindcompvcl;vclie;vcltouch;Intraweb_120_160;websnap;vclribbon;VclSmp;frxe16;fsDB16;dbcache;vcl;CloudService;CodeSiteExpressPkg;FmxTeeUI;dsnapcon;vclx;webdsnap;svn;ColorButton;bdertl;adortl;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + 1033 + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + + + DEBUG;$(DCC_Define) + false + true + true + true + + + false + + + false + RELEASE;$(DCC_Define) + 0 + false + + + + MainSource + + + + + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + + + + Delphi.Personality.12 + + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 2067 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + ProScanTests.dpr + + + + + False + False + True + + + DUnit / Delphi Win32 + GUI + E:\svn\Delphi\ProScan\ProScan.dproj + + + 12 + + + + Index: ProScan/Test/TextTestRunner.dcu =================================================================== diff -u Binary files differ Index: ProScan/Test/TestCommonFunctions.dcu =================================================================== diff -u Binary files differ Index: ProScan/Test/DUnitTestRunner.dcu =================================================================== diff -u Binary files differ Index: ProScan/Test/TestCommonFunctions.pas =================================================================== diff -u --- ProScan/Test/TestCommonFunctions.pas (revision 0) +++ ProScan/Test/TestCommonFunctions.pas (revision 398) @@ -0,0 +1,112 @@ +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. + Index: ProScan/Test/GUITestRunner.dcu =================================================================== diff -u Binary files differ Index: ProScan/ProScan.dproj =================================================================== diff -u -r396 -r398 --- ProScan/ProScan.dproj (.../ProScan.dproj) (revision 396) +++ ProScan/ProScan.dproj (.../ProScan.dproj) (revision 398) @@ -190,7 +190,7 @@ True - E:\svn\Delphi\AAPClient\Test\ProScanTests.dproj + E:\svn\Delphi\ProScan\Test\ProScanTests.dproj 12 Index: ProScan/Test/TestFramework.dcu =================================================================== diff -u Binary files differ