├── .gitignore
├── DUnit
├── COM
│ ├── Debug
│ │ └── Win32
│ │ │ └── dunit.ini
│ ├── Testthundax.COMLib.pas
│ ├── thundax.COMLib.dll
│ ├── thundax.COMLib_10.dll
│ ├── thundax.COMTest.dpr
│ ├── thundax.COMTest.dproj
│ ├── thundax.COMTest_10.dpr
│ ├── thundax.COMTest_10.dproj
│ ├── thundax.COMTest_10.dproj.local
│ ├── thundax.COMTest_10.identcache
│ └── thundax.COMTest_10.res
├── Charts
│ ├── thundax.ChartTest.dpr
│ ├── thundax.ChartTest.dproj
│ ├── thundax.ChartTest_10.dpr
│ ├── thundax.ChartTest_10.dproj
│ ├── thundax.ChartTest_10.dproj.local
│ ├── thundax.ChartTest_10.identcache
│ └── thundax.ChartTest_10.res
├── ClassHelper
│ ├── Testthundax.classHelper.pas
│ ├── dunit.ini
│ ├── thundax.ClassHelper.dpr
│ ├── thundax.ClassHelper.dproj
│ ├── thundax.ClassHelper_10.dpr
│ ├── thundax.ClassHelper_10.dproj
│ ├── thundax.ClassHelper_10.dproj.local
│ ├── thundax.ClassHelper_10.identcache
│ ├── thundax.ClassHelper_10.res
│ └── thundax.ClassHelper_10.stat
├── ClassOperator
│ ├── Testthundax.ClassOperator.pas
│ ├── dunit.ini
│ ├── thundax.ClassOperator.dpr
│ ├── thundax.ClassOperator.dproj
│ ├── thundax.ClassOperator_10.dpr
│ ├── thundax.ClassOperator_10.dproj
│ ├── thundax.ClassOperator_10.dproj.local
│ ├── thundax.ClassOperator_10.identcache
│ └── thundax.ClassOperator_10.res
├── Custom Attributes
│ ├── TestThundax.customAttributes.pas
│ ├── dunit.ini
│ ├── thundax.CustomAttributesTest.dpr
│ ├── thundax.CustomAttributesTest.dproj
│ ├── thundax.CustomAttributesTest_10.dpr
│ ├── thundax.CustomAttributesTest_10.dproj
│ ├── thundax.CustomAttributesTest_10.dproj.local
│ ├── thundax.CustomAttributesTest_10.identcache
│ └── thundax.CustomAttributesTest_10.res
├── Design Patterns
│ ├── CodeCoverage_Summary.xml
│ ├── CodeCoverage_summary.html
│ ├── Delphi-Code-Coverage-Debug.log
│ ├── Testthundax.DesignPatterns.pas
│ ├── coverage.ec
│ ├── coverage.em
│ ├── coverage.es
│ ├── coverage
│ │ ├── _files
│ │ │ ├── 0.html
│ │ │ ├── 1.html
│ │ │ ├── 2.html
│ │ │ └── 3.html
│ │ └── index.html
│ ├── dcov_emma.bat
│ ├── dcov_execute.bat
│ ├── dcov_paths.lst
│ ├── dcov_units.lst
│ ├── dunit.ini
│ ├── emma.jar
│ ├── thundax.AbstractFactory(thundax.AbstractFactory.pas).html
│ ├── thundax.DesignPatternsTest.dpr
│ ├── thundax.DesignPatternsTest.dproj
│ ├── thundax.DesignPatternsTest.drc
│ ├── thundax.DesignPatternsTest.map
│ ├── thundax.DesignPatternsTest_10.dpr
│ ├── thundax.DesignPatternsTest_10.dproj
│ ├── thundax.DesignPatternsTest_10.dproj.local
│ ├── thundax.DesignPatternsTest_10.drc
│ ├── thundax.DesignPatternsTest_10.identcache
│ ├── thundax.DesignPatternsTest_10.map
│ ├── thundax.DesignPatternsTest_10.res
│ └── thundax.Prototype(thundax.Prototype.pas).html
├── Fluent Interfaces
│ ├── Testthundax.fluentInterface.pas
│ ├── dunit.ini
│ ├── thundax.FluentInterfacesTest.dpr
│ ├── thundax.FluentInterfacesTest.dproj
│ ├── thundax.FluentInterfacesTest_10.dpr
│ ├── thundax.FluentInterfacesTest_10.dproj
│ ├── thundax.FluentInterfacesTest_10.dproj.local
│ ├── thundax.FluentInterfacesTest_10.identcache
│ └── thundax.FluentInterfacesTest_10.res
├── Logging
│ ├── Debug
│ │ └── Win32
│ │ │ ├── dunit.ini
│ │ │ └── logTestFile.txt
│ ├── Testthundax.logging.pas
│ ├── dunit.ini
│ ├── logTestFile.txt
│ ├── thundax.LoggingTest.dpr
│ ├── thundax.LoggingTest.dproj
│ ├── thundax.LoggingTest_10.dpr
│ ├── thundax.LoggingTest_10.dproj
│ ├── thundax.LoggingTest_10.dproj.local
│ ├── thundax.LoggingTest_10.identcache
│ └── thundax.LoggingTest_10.res
├── Mock
│ ├── TestThundax.mock.pas
│ ├── dunit.ini
│ ├── thundax.MockTest.dpr
│ ├── thundax.MockTest.dproj
│ ├── thundax.MockTest.drc
│ ├── thundax.MockTest.map
│ ├── thundax.MockTest_10.dpr
│ ├── thundax.MockTest_10.dproj
│ ├── thundax.MockTest_10.dproj.local
│ ├── thundax.MockTest_10.drc
│ ├── thundax.MockTest_10.identcache
│ ├── thundax.MockTest_10.map
│ ├── thundax.MockTest_10.res
│ └── thundax.MockTest_10.stat
├── Multi-Threading
│ ├── Testthundax.Multithreading.pas
│ ├── dunit.ini
│ ├── thundax.MultiThreadingTest.dpr
│ ├── thundax.MultiThreadingTest.dproj
│ ├── thundax.MultiThreadingTest_10.dpr
│ ├── thundax.MultiThreadingTest_10.dproj
│ ├── thundax.MultiThreadingTest_10.dproj.local
│ ├── thundax.MultiThreadingTest_10.identcache
│ ├── thundax.MultiThreadingTest_10.res
│ └── thundax.MultiThreadingTest_10.stat
├── Profiler
│ ├── thundax.ProfilerTest.dpr
│ ├── thundax.ProfilerTest.dproj
│ ├── thundax.ProfilerTest_10.dpr
│ ├── thundax.ProfilerTest_10.dproj
│ ├── thundax.ProfilerTest_10.dproj.local
│ ├── thundax.ProfilerTest_10.identcache
│ └── thundax.ProfilerTest_10.res
├── Refactoring
│ ├── Refactoring.pptx
│ ├── Testthundax.refactoring.pas
│ ├── thundax.Refactoring_10.dpr
│ ├── thundax.Refactoring_10.dproj
│ ├── thundax.Refactoring_10.dproj.local
│ ├── thundax.Refactoring_10.res
│ └── thundax.stat
├── Regular Expressions
│ ├── Testthundax.RegularExpressions.pas
│ ├── dunit.ini
│ ├── thundax.RegularExpressionsTest.dpr
│ ├── thundax.RegularExpressionsTest.dproj
│ ├── thundax.RegularExpressionsTest_10.dpr
│ ├── thundax.RegularExpressionsTest_10.dproj
│ ├── thundax.RegularExpressionsTest_10.dproj.local
│ ├── thundax.RegularExpressionsTest_10.identcache
│ └── thundax.RegularExpressionsTest_10.res
└── UML
│ ├── TestDiagramUML.jpg
│ ├── TestDiagramUML.sdx
│ ├── Testthundax.UMLDiagrams.pas
│ ├── dunit.ini
│ ├── thundax.UMLDiagramsTest.dpr
│ ├── thundax.UMLDiagramsTest.dproj
│ ├── thundax.UMLDiagramsTest_10.dpr
│ ├── thundax.UMLDiagramsTest_10.dproj
│ ├── thundax.UMLDiagramsTest_10.dproj.local
│ ├── thundax.UMLDiagramsTest_10.identcache
│ └── thundax.UMLDiagramsTest_10.res
├── README.md
├── src
├── COM
│ ├── interface
│ │ └── thundax.COMLib.contract.pas
│ ├── thundax.COMLib.Instance.pas
│ ├── thundax.COMLib.dpr
│ ├── thundax.COMLib.dproj
│ ├── thundax.COMLib.tlb
│ ├── thundax.COMLib_10.dpr
│ ├── thundax.COMLib_10.dproj
│ ├── thundax.COMLib_10.dproj.local
│ ├── thundax.COMLib_10.identcache
│ ├── thundax.COMLib_10.res
│ ├── thundax.COMLib_10.stat
│ ├── thundax.COMLib_10.tlb
│ └── tlb
│ │ ├── COMLib.ridl
│ │ └── COMLib.tlb
├── ClassHelper
│ └── thundax.classHelper.example.pas
├── ClassOperator
│ └── thundax.classOperator.example.pas
├── Custom Attributes
│ ├── thundax.customAttributes.Example.pas
│ └── thundax.customAttributes.Framework.pas
├── Design Patterns
│ ├── AbstractFactory
│ │ └── thundax.AbstractFactory.pas
│ └── Prototype
│ │ └── thundax.Prototype.pas
├── Fluent Interfaces
│ ├── thundax.fluentInterface.example.pas
│ └── thundax.fluentInterface.testimplementation.pas
├── Logging
│ └── thundax.logging.pas
├── Mock
│ ├── thundax.mock.example.pas
│ └── thundax.mock.pas
├── Multi-Threading
│ └── thundax.Multithreading.example.pas
├── Refactoring
│ └── thundax.refactoring.example.pas
├── Regular Expressions
│ ├── thundax.stringHelper.contract.pas
│ └── thundax.stringHelper.pas
└── UML
│ └── thundax.UML.pas
├── thirdpartylibs
└── sdedit
│ ├── license.txt
│ └── sdedit.jar
├── thundax.projectGroup.groupproj
└── thundax.projectGroup.groupproj.local
/.gitignore:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # This .gitignore file was automatically created by Microsoft(R) Visual Studio.
3 | ################################################################################
4 |
5 | /DUnit/Charts/dcu
6 | /DUnit/ClassHelper/dcu
7 | *.dcu
8 | /DUnit/COM/__history
9 | *.exe
10 | /src/Multi-Threading/__history
11 | /DUnit/Charts/__history
12 | /DUnit/ClassHelper/__history
13 | /DUnit/ClassOperator/__history
14 | /DUnit/Custom Attributes/__history
15 | /DUnit/Design Patterns/__history
16 | /DUnit/Fluent Interfaces/__history
17 | /DUnit/Logging/__history
18 | /DUnit/Mock/__history
19 | /DUnit/Multi-Threading/__history
20 | /DUnit/Profiler/__history
21 | /DUnit/Regular Expressions/__history
22 | /src/COM/__history
23 | /DUnit/UML/__history
24 | /DUnit/Refactoring/Win32/Debug
25 | /DUnit/Refactoring/Win64/Debug
26 | /DUnit/Refactoring/__history
27 | /src/Refactoring/__history
28 | /src/Refactoring/__recovery
29 | *.stat
30 |
--------------------------------------------------------------------------------
/DUnit/COM/Debug/Win32/dunit.ini:
--------------------------------------------------------------------------------
1 | [GUITestRunner Config]
2 | AutoSave=1
3 | Left=25
4 | Top=25
5 | Width=508
6 | Height=504
7 | Maximized=0
8 | UseRegistry=0
9 | ResultsPanel.Height=174
10 | ErrorMessage.Height=75
11 | ErrorMessage.Visible=1
12 | FailureList.ColumnWidth[0]=120
13 | FailureList.ColumnWidth[1]=100
14 | FailureList.ColumnWidth[2]=200
15 | FailureList.ColumnWidth[3]=60
16 | HideTestNodesOnOpen=0
17 | BreakOnFailures=0
18 | FailOnNoChecksExecuted=0
19 | FailOnMemoryLeaked=0
20 | IgnoreSetUpTearDownLeaks=0
21 | ReportMemoryLeakTypes=0
22 | SelectTestedNode=1
23 | WarnOnFailTestOverride=0
24 | PopupX=350
25 | PopupY=30
26 |
27 |
--------------------------------------------------------------------------------
/DUnit/COM/Testthundax.COMLib.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit Testthundax.COMLib;
29 | {
30 |
31 | Delphi DUnit Test Case
32 | ----------------------
33 | This unit contains a skeleton test case class generated by the Test Case Wizard.
34 | Modify the generated code to correctly setup and call the methods from the unit
35 | being tested.
36 |
37 | }
38 |
39 | interface
40 |
41 | uses
42 | TestFramework, ComObj, thundax.COMLib.contract, Windows, ActiveX;
43 |
44 | type
45 | TRegProcFunc = function: HResult; stdcall;
46 |
47 | TestTCOMLib = class(TTestCase)
48 | strict private
49 | FCOMLib: ICOMLib;
50 | private
51 | procedure RegisterDLL;
52 | function ExecuteProcess(const ExecuteFile, ParamString: string): boolean;
53 | public
54 | procedure SetUp; override;
55 | procedure TearDown; override;
56 | published
57 | procedure TestExecute;
58 | end;
59 |
60 | implementation
61 |
62 | uses
63 | SysUtils, Classes, vcl.Forms, ShellAPI;
64 |
65 | function TestTCOMLib.ExecuteProcess(const ExecuteFile, ParamString: string): boolean;
66 | var
67 | SEInfo: TShellExecuteInfo;
68 | ExitCode: DWORD;
69 | begin
70 | FillChar(SEInfo, SizeOf(SEInfo), 0);
71 | SEInfo.cbSize := SizeOf(TShellExecuteInfo);
72 |
73 | SEInfo.fMask := SEE_MASK_NOCLOSEPROCESS;
74 | SEInfo.Wnd := Application.Handle;
75 | SEInfo.lpFile := PChar(ExecuteFile);
76 | SEInfo.lpParameters := PChar(ParamString);
77 | SEInfo.nShow := SW_HIDE;
78 |
79 | Result := False;
80 | if ShellExecuteEx(@SEInfo) then
81 | begin
82 | repeat
83 | Application.ProcessMessages;
84 | GetExitCodeProcess(SEInfo.hProcess, ExitCode);
85 | until (ExitCode <> STILL_ACTIVE) or Application.Terminated;
86 | Result := True;
87 | end;
88 | end;
89 |
90 | procedure TestTCOMLib.RegisterDLL;
91 | var
92 | AProcRegFunc: TRegProcFunc;
93 | handle: THandle;
94 | dllPath: string;
95 | begin
96 | try
97 | dllPath := ExtractFilePath(Application.ExeName) + 'thundax.COMLib.dll';
98 | handle := LoadLibrary(PChar(dllPath));
99 | if handle <> 0 then
100 | begin
101 | AProcRegFunc := GetProcAddress(handle, 'DllRegisterServer');
102 | if Assigned(AProcRegFunc) then
103 | ExecuteProcess('regsvr32', '/s ' + dllPath);
104 | FreeLibrary(handle);
105 | end;
106 | except
107 | end;
108 | end;
109 |
110 | procedure TestTCOMLib.SetUp;
111 | begin
112 | OleCheck(CoCreateInstance(Class_COMLib, nil, CLSCTX_ALL, ICOMLib, FCOMLib));
113 | end;
114 |
115 | procedure TestTCOMLib.TearDown;
116 | begin
117 | FCOMLib := nil;
118 | end;
119 |
120 | procedure TestTCOMLib.TestExecute;
121 | var
122 | ReturnValue: string;
123 | param: string;
124 | begin
125 | RegisterDLL;
126 | param := 'Test';
127 | ReturnValue := FCOMLib.Execute(param);
128 | CheckTrue(ReturnValue = 'TCOMLibExample Executed with param: Test', 'Invalid response from the COM Object');
129 | end;
130 |
131 | initialization
132 |
133 | // Register any test cases with the test runner
134 | RegisterTest(TestTCOMLib.Suite);
135 |
136 | end.
137 |
--------------------------------------------------------------------------------
/DUnit/COM/thundax.COMLib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/COM/thundax.COMLib.dll
--------------------------------------------------------------------------------
/DUnit/COM/thundax.COMLib_10.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/COM/thundax.COMLib_10.dll
--------------------------------------------------------------------------------
/DUnit/COM/thundax.COMTest.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.COMTest;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | Testthundax.COMLib in 'Testthundax.COMLib.pas';
50 |
51 | {$R *.RES}
52 |
53 | begin
54 | Application.Initialize;
55 | if IsConsole then
56 | with TextTestRunner.RunRegisteredTests do
57 | Free
58 | else
59 | GUITestRunner.RunRegisteredTests;
60 | end.
61 |
62 |
--------------------------------------------------------------------------------
/DUnit/COM/thundax.COMTest_10.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.COMTest_10;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | Testthundax.COMLib in 'Testthundax.COMLib.pas';
50 |
51 | {$R *.RES}
52 |
53 | begin
54 | Application.Initialize;
55 | if IsConsole then
56 | with TextTestRunner.RunRegisteredTests do
57 | Free
58 | else
59 | GUITestRunner.RunRegisteredTests;
60 | end.
61 |
62 |
--------------------------------------------------------------------------------
/DUnit/COM/thundax.COMTest_10.dproj.local:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2017/05/19 19:12:47.000.170,C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\COM\thundax.COMTest.dproj=C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\COM\thundax.COMTest_10.dproj
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DUnit/COM/thundax.COMTest_10.identcache:
--------------------------------------------------------------------------------
1 | _C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\COM\Testthundax.COMLib.pas _C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\COM\thundax.COMTest_10.dpr
--------------------------------------------------------------------------------
/DUnit/COM/thundax.COMTest_10.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/COM/thundax.COMTest_10.res
--------------------------------------------------------------------------------
/DUnit/Charts/thundax.ChartTest.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.ChartTest;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner;
49 |
50 | {$R *.RES}
51 |
52 | begin
53 | Application.Initialize;
54 | ReportMemoryLeaksOnShutdown := True;
55 | if IsConsole then
56 | with TextTestRunner.RunRegisteredTests do
57 | Free
58 | else
59 | GUITestRunner.RunRegisteredTests;
60 | end.
61 |
62 |
--------------------------------------------------------------------------------
/DUnit/Charts/thundax.ChartTest_10.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.ChartTest_10;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner;
49 |
50 | {$R *.RES}
51 |
52 | begin
53 | Application.Initialize;
54 | ReportMemoryLeaksOnShutdown := True;
55 | if IsConsole then
56 | with TextTestRunner.RunRegisteredTests do
57 | Free
58 | else
59 | GUITestRunner.RunRegisteredTests;
60 | end.
61 |
62 |
--------------------------------------------------------------------------------
/DUnit/Charts/thundax.ChartTest_10.dproj.local:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2017/05/19 19:12:47.000.100,C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Charts\thundax.ChartTest.dproj=C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Charts\thundax.ChartTest_10.dproj
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DUnit/Charts/thundax.ChartTest_10.identcache:
--------------------------------------------------------------------------------
1 | dC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Charts\thundax.ChartTest_10.dpr
--------------------------------------------------------------------------------
/DUnit/Charts/thundax.ChartTest_10.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Charts/thundax.ChartTest_10.res
--------------------------------------------------------------------------------
/DUnit/ClassHelper/Testthundax.classHelper.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit Testthundax.classHelper;
29 | {
30 |
31 | Delphi DUnit Test Case
32 | ----------------------
33 | This unit contains a skeleton test case class generated by the Test Case Wizard.
34 | Modify the generated code to correctly setup and call the methods from the unit
35 | being tested.
36 |
37 | }
38 |
39 | interface
40 |
41 | uses
42 | TestFramework, thundax.classHelper.example;
43 |
44 | type
45 | // Test methods for class TSQL
46 |
47 | TestTSQL = class(TTestCase)
48 | strict private
49 | FSQL: TSQL;
50 | public
51 | procedure SetUp; override;
52 | procedure TearDown; override;
53 | published
54 | procedure TestgetQuery;
55 | end;
56 |
57 | implementation
58 |
59 | procedure TestTSQL.SetUp;
60 | begin
61 | FSQL := TSQL.Create;
62 | end;
63 |
64 | procedure TestTSQL.TearDown;
65 | begin
66 | FSQL.Free;
67 | FSQL := nil;
68 | end;
69 |
70 | procedure TestTSQL.TestgetQuery;
71 | var
72 | ReturnValue: string;
73 | begin
74 | ReturnValue := FSQL.getQuery;
75 | checkTrue(ReturnValue <> '', 'Error query cannot be empty');
76 | ReturnValue := FSQL.formatParameter(1);
77 | checkTrue(ReturnValue = '1', 'Error query cannot be empty');
78 | end;
79 |
80 | initialization
81 | // Register any test cases with the test runner
82 | RegisterTest(TestTSQL.Suite);
83 | end.
84 |
85 |
--------------------------------------------------------------------------------
/DUnit/ClassHelper/dunit.ini:
--------------------------------------------------------------------------------
1 | [GUITestRunner Config]
2 | AutoSave=1
3 | Left=175
4 | Top=175
5 | Width=508
6 | Height=504
7 | Maximized=0
8 | UseRegistry=0
9 | ResultsPanel.Height=174
10 | ErrorMessage.Height=75
11 | ErrorMessage.Visible=1
12 | FailureList.ColumnWidth[0]=120
13 | FailureList.ColumnWidth[1]=100
14 | FailureList.ColumnWidth[2]=200
15 | FailureList.ColumnWidth[3]=60
16 | HideTestNodesOnOpen=0
17 | BreakOnFailures=0
18 | FailOnNoChecksExecuted=0
19 | FailOnMemoryLeaked=0
20 | IgnoreSetUpTearDownLeaks=0
21 | ReportMemoryLeakTypes=0
22 | SelectTestedNode=1
23 | WarnOnFailTestOverride=0
24 | PopupX=350
25 | PopupY=30
26 |
27 |
--------------------------------------------------------------------------------
/DUnit/ClassHelper/thundax.ClassHelper.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.ClassHelper;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.classHelper.example in '..\..\src\ClassHelper\thundax.classHelper.example.pas',
50 | Testthundax.classHelper in 'Testthundax.classHelper.pas';
51 |
52 | {$R *.RES}
53 |
54 | begin
55 | Application.Initialize;
56 | if IsConsole then
57 | with TextTestRunner.RunRegisteredTests do
58 | Free
59 | else
60 | GUITestRunner.RunRegisteredTests;
61 | end.
62 |
63 |
--------------------------------------------------------------------------------
/DUnit/ClassHelper/thundax.ClassHelper_10.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.ClassHelper_10;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.classHelper.example in '..\..\src\ClassHelper\thundax.classHelper.example.pas',
50 | Testthundax.classHelper in 'Testthundax.classHelper.pas';
51 |
52 | {$R *.RES}
53 |
54 | begin
55 | Application.Initialize;
56 | if IsConsole then
57 | with TextTestRunner.RunRegisteredTests do
58 | Free
59 | else
60 | GUITestRunner.RunRegisteredTests;
61 | end.
62 |
63 |
--------------------------------------------------------------------------------
/DUnit/ClassHelper/thundax.ClassHelper_10.dproj.local:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2017/05/19 19:12:47.000.222,C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\ClassHelper\thundax.ClassHelper.dproj=C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\ClassHelper\thundax.ClassHelper_10.dproj
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DUnit/ClassHelper/thundax.ClassHelper_10.identcache:
--------------------------------------------------------------------------------
1 | lC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\ClassHelper\Testthundax.classHelper.pas nC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\ClassHelper\thundax.classHelper.example.pas kC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\ClassHelper\thundax.ClassHelper_10.dpr
--------------------------------------------------------------------------------
/DUnit/ClassHelper/thundax.ClassHelper_10.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/ClassHelper/thundax.ClassHelper_10.res
--------------------------------------------------------------------------------
/DUnit/ClassHelper/thundax.ClassHelper_10.stat:
--------------------------------------------------------------------------------
1 | [Stats]
2 | EditorSecs=1
3 | DesignerSecs=1
4 | InspectorSecs=1
5 | CompileSecs=282
6 | OtherSecs=45
7 | StartTime=19/05/2017 19:14:49
8 | RealKeys=0
9 | EffectiveKeys=0
10 | DebugSecs=11
11 |
--------------------------------------------------------------------------------
/DUnit/ClassOperator/Testthundax.ClassOperator.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit Testthundax.ClassOperator;
29 | {
30 |
31 | Delphi DUnit Test Case
32 | ----------------------
33 | This unit contains a skeleton test case class generated by the Test Case Wizard.
34 | Modify the generated code to correctly setup and call the methods from the unit
35 | being tested.
36 |
37 | }
38 |
39 | interface
40 |
41 | uses
42 | TestFramework, thundax.classOperator.example;
43 |
44 | type
45 | // Test methods for record TClassOperator
46 |
47 | TestTClassOperator = class(TTestCase)
48 | strict private
49 |
50 | public
51 | procedure SetUp; override;
52 | procedure TearDown; override;
53 | published
54 | procedure TestOperators;
55 | end;
56 |
57 | implementation
58 |
59 | procedure TestTClassOperator.SetUp;
60 | begin
61 |
62 | end;
63 |
64 | procedure TestTClassOperator.TearDown;
65 | begin
66 |
67 | end;
68 |
69 | procedure TestTClassOperator.TestOperators;
70 | var
71 | x, y, b: TMyRecord;
72 | begin
73 | x := 12; // Implicit conversion from an Integer
74 | CheckTrue(x = 12, 'Error implicit conversion from an Integer');
75 | y := x + x; // Calls TMyRecord.Add(a, b: TMyClass): TMyClass
76 | CheckTrue(y = 24, 'Error Addition');
77 | b := x;
78 | b := b + 100 + y; // Calls TMyRecord.Add(a, b) twice
79 | CheckTrue(b = 136, 'Error Complex Addition');
80 | b := b * 2; // Calls TMyRecord.Multiply(a, b)
81 | CheckTrue(b = 272, 'Error Multiplication');
82 | b := b div 2; // Calls TMyRecord.IntDivide(a, b)
83 | CheckTrue(b = 136, 'Error Division');
84 | end;
85 |
86 | initialization
87 | // Register any test cases with the test runner
88 | RegisterTest(TestTClassOperator.Suite);
89 | end.
90 |
91 |
--------------------------------------------------------------------------------
/DUnit/ClassOperator/dunit.ini:
--------------------------------------------------------------------------------
1 | [GUITestRunner Config]
2 | AutoSave=1
3 | Left=75
4 | Top=75
5 | Width=508
6 | Height=504
7 | Maximized=0
8 | UseRegistry=0
9 | ResultsPanel.Height=174
10 | ErrorMessage.Height=75
11 | ErrorMessage.Visible=1
12 | FailureList.ColumnWidth[0]=120
13 | FailureList.ColumnWidth[1]=100
14 | FailureList.ColumnWidth[2]=200
15 | FailureList.ColumnWidth[3]=60
16 | HideTestNodesOnOpen=0
17 | BreakOnFailures=0
18 | FailOnNoChecksExecuted=0
19 | FailOnMemoryLeaked=0
20 | IgnoreSetUpTearDownLeaks=0
21 | ReportMemoryLeakTypes=0
22 | SelectTestedNode=1
23 | WarnOnFailTestOverride=0
24 | PopupX=350
25 | PopupY=30
26 |
27 |
--------------------------------------------------------------------------------
/DUnit/ClassOperator/thundax.ClassOperator.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.ClassOperator;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.classOperator.example in '..\..\src\ClassOperator\thundax.classOperator.example.pas',
50 | Testthundax.ClassOperator in 'Testthundax.ClassOperator.pas',
51 | thundax.logging in '..\..\src\Logging\thundax.logging.pas';
52 |
53 | {R *.RES}
54 |
55 | begin
56 | Application.Initialize;
57 | if IsConsole then
58 | with TextTestRunner.RunRegisteredTests do
59 | Free
60 | else
61 | GUITestRunner.RunRegisteredTests;
62 | end.
63 |
64 |
--------------------------------------------------------------------------------
/DUnit/ClassOperator/thundax.ClassOperator_10.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.ClassOperator_10;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.classOperator.example in '..\..\src\ClassOperator\thundax.classOperator.example.pas',
50 | Testthundax.ClassOperator in 'Testthundax.ClassOperator.pas',
51 | thundax.logging in '..\..\src\Logging\thundax.logging.pas';
52 |
53 | {R *.RES}
54 |
55 | begin
56 | Application.Initialize;
57 | if IsConsole then
58 | with TextTestRunner.RunRegisteredTests do
59 | Free
60 | else
61 | GUITestRunner.RunRegisteredTests;
62 | end.
63 |
64 |
--------------------------------------------------------------------------------
/DUnit/ClassOperator/thundax.ClassOperator_10.dproj.local:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2017/05/19 19:12:47.000.199,C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\ClassOperator\thundax.ClassOperator.dproj=C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\ClassOperator\thundax.ClassOperator_10.dproj
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DUnit/ClassOperator/thundax.ClassOperator_10.identcache:
--------------------------------------------------------------------------------
1 | pC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\ClassOperator\Testthundax.ClassOperator.pas oC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\ClassOperator\thundax.ClassOperator_10.dpr ^C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\Logging\thundax.logging.pas rC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\ClassOperator\thundax.classOperator.example.pas
--------------------------------------------------------------------------------
/DUnit/ClassOperator/thundax.ClassOperator_10.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/ClassOperator/thundax.ClassOperator_10.res
--------------------------------------------------------------------------------
/DUnit/Custom Attributes/TestThundax.customAttributes.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit TestThundax.customAttributes;
29 | {
30 |
31 | Delphi DUnit Test Case
32 | ----------------------
33 | This unit contains a skeleton test case class generated by the Test Case Wizard.
34 | Modify the generated code to correctly setup and call the methods from the unit
35 | being tested.
36 |
37 | }
38 |
39 | interface
40 |
41 | uses
42 | TestFramework, thundax.customAttributes.Example, thundax.customAttributes.Framework;
43 |
44 | type
45 | // Test methods for class TLogin
46 |
47 | TestTLogin = class(TFrameworkTestCase)
48 | strict private
49 | FLogin: TLogin;
50 | public
51 | procedure SetUp; override;
52 | procedure TearDown; override;
53 | published
54 | [TUserPasswordAttribute('User1', 'Password1', True)]
55 | [TUserPasswordAttribute('User2', 'Password2', True)]
56 | [TUserPasswordAttribute('User3', 'Password3', True)]
57 | [TUserPasswordAttribute('User3', '', False)]
58 | procedure TestUserLogin;
59 | [TUserAgeAttribute('User1', 26, True)]
60 | [TUserAgeAttribute('User2', 27, True)]
61 | [TUserAgeAttribute('User3', 28, False)]
62 | procedure TestfetchDatauser;
63 | end;
64 |
65 | implementation
66 |
67 | procedure TestTLogin.SetUp;
68 | begin
69 | FLogin := TLogin.Create;
70 | end;
71 |
72 | procedure TestTLogin.TearDown;
73 | begin
74 | FLogin.Free;
75 | FLogin := nil;
76 | end;
77 |
78 | procedure TestTLogin.TestUserLogin;
79 | var
80 | aPassword: string;
81 | aUserName: string;
82 | aResponse : boolean;
83 | begin
84 | TestAttributesMethod(procedure (CustomAttr : TCustomAttribute)
85 | begin
86 | if CustomAttr is TUserPasswordAttribute then
87 | begin
88 | aUserName := TUserPasswordAttribute(CustomAttr).UserName;
89 | aPassword := TUserPasswordAttribute(CustomAttr).Password;
90 | aResponse := TUserPasswordAttribute(CustomAttr).Response;
91 | CheckTrue(FLogin.UserLogin(aUserName, aPassword)=aResponse, 'Incorrect user ' + aUserName);
92 | end;
93 | end);
94 | end;
95 |
96 | procedure TestTLogin.TestfetchDatauser;
97 | var
98 | aAge: integer;
99 | aUserName: string;
100 | aResponse : boolean;
101 | begin
102 | TestAttributesMethod(procedure (CustomAttr : TCustomAttribute)
103 | begin
104 | if CustomAttr is TUserAgeAttribute then
105 | begin
106 | aUserName := TUserAgeAttribute(CustomAttr).UserName;
107 | aAge := TUserAgeAttribute(CustomAttr).Age;
108 | aResponse := TUserAgeAttribute(CustomAttr).Response;
109 | CheckTrue(aResponse=(FLogin.fetchDatauser(aUserName)=aAge), 'Incorrect value ' + aUserName);
110 | end;
111 | end);
112 | end;
113 |
114 | initialization
115 | // Register any test cases with the test runner
116 | ReportMemoryLeaksOnShutdown := true;
117 | RegisterTest(TestTLogin.Suite);
118 | end.
119 |
120 |
--------------------------------------------------------------------------------
/DUnit/Custom Attributes/dunit.ini:
--------------------------------------------------------------------------------
1 | [GUITestRunner Config]
2 | AutoSave=1
3 | Left=154
4 | Top=154
5 | Width=500
6 | Height=500
7 | Maximized=0
8 | UseRegistry=0
9 | ResultsPanel.Height=174
10 | ErrorMessage.Height=75
11 | ErrorMessage.Visible=1
12 | FailureList.ColumnWidth[0]=120
13 | FailureList.ColumnWidth[1]=100
14 | FailureList.ColumnWidth[2]=200
15 | FailureList.ColumnWidth[3]=52
16 | HideTestNodesOnOpen=0
17 | BreakOnFailures=0
18 | FailOnNoChecksExecuted=0
19 | FailOnMemoryLeaked=0
20 | IgnoreSetUpTearDownLeaks=0
21 | ReportMemoryLeakTypes=0
22 | SelectTestedNode=1
23 | WarnOnFailTestOverride=0
24 | PopupX=350
25 | PopupY=30
26 |
27 |
--------------------------------------------------------------------------------
/DUnit/Custom Attributes/thundax.CustomAttributesTest.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.CustomAttributesTest;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.customAttributes.Framework in '..\..\src\Custom Attributes\thundax.customAttributes.Framework.pas',
50 | thundax.customAttributes.Example in '..\..\src\Custom Attributes\thundax.customAttributes.Example.pas',
51 | TestThundax.customAttributes in 'TestThundax.customAttributes.pas';
52 |
53 | {R *.RES}
54 |
55 | begin
56 | Application.Initialize;
57 | ReportMemoryLeaksOnShutdown := True;
58 | if IsConsole then
59 | with TextTestRunner.RunRegisteredTests do
60 | Free
61 | else
62 | GUITestRunner.RunRegisteredTests;
63 | end.
64 |
65 |
--------------------------------------------------------------------------------
/DUnit/Custom Attributes/thundax.CustomAttributesTest_10.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.CustomAttributesTest_10;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.customAttributes.Framework in '..\..\src\Custom Attributes\thundax.customAttributes.Framework.pas',
50 | thundax.customAttributes.Example in '..\..\src\Custom Attributes\thundax.customAttributes.Example.pas',
51 | TestThundax.customAttributes in 'TestThundax.customAttributes.pas';
52 |
53 | {R *.RES}
54 |
55 | begin
56 | Application.Initialize;
57 | ReportMemoryLeaksOnShutdown := True;
58 | if IsConsole then
59 | with TextTestRunner.RunRegisteredTests do
60 | Free
61 | else
62 | GUITestRunner.RunRegisteredTests;
63 | end.
64 |
65 |
--------------------------------------------------------------------------------
/DUnit/Custom Attributes/thundax.CustomAttributesTest_10.dproj.local:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2017/05/19 19:12:42.000.276,C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Custom Attributes\thundax.CustomAttributesTest.dproj=C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Custom Attributes\thundax.CustomAttributesTest_10.dproj
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DUnit/Custom Attributes/thundax.CustomAttributesTest_10.identcache:
--------------------------------------------------------------------------------
1 | zC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Custom Attributes\thundax.CustomAttributesTest_10.dpr yC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\Custom Attributes\thundax.customAttributes.Example.pas {C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\Custom Attributes\thundax.customAttributes.Framework.pas wC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Custom Attributes\TestThundax.customAttributes.pas
--------------------------------------------------------------------------------
/DUnit/Custom Attributes/thundax.CustomAttributesTest_10.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Custom Attributes/thundax.CustomAttributesTest_10.res
--------------------------------------------------------------------------------
/DUnit/Design Patterns/CodeCoverage_summary.html:
--------------------------------------------------------------------------------
1 |
47 |
48 |
--------------------------------------------------------------------------------
/DUnit/Design Patterns/Testthundax.DesignPatterns.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit Testthundax.DesignPatterns;
29 | {
30 |
31 | Delphi DUnit Test Case
32 | ----------------------
33 | This unit contains a skeleton test case class generated by the Test Case Wizard.
34 | Modify the generated code to correctly setup and call the methods from the unit
35 | being tested.
36 |
37 | }
38 |
39 | interface
40 |
41 | uses
42 | TestFramework, Generics.Collections, Contnrs, thundax.Prototype, thundax.AbstractFactory;
43 |
44 | type
45 | // Test methods for class TPrototypeFactory
46 |
47 | TestDesignPatterns = class(TTestCase)
48 | strict private
49 | FPrototypeFactory: TPrototypeFactory;
50 | FVehicleFactory: TVehicleFactory;
51 | public
52 | procedure SetUp; override;
53 | procedure TearDown; override;
54 | published
55 | procedure TestMakeObject;
56 | procedure TestFactory;
57 | end;
58 |
59 | implementation
60 |
61 | uses
62 | SysUtils;
63 |
64 | procedure TestDesignPatterns.SetUp;
65 | begin
66 | FPrototypeFactory := TPrototypeFactory.Create;
67 | FVehicleFactory:= TVehicleFactory.Create;
68 | end;
69 |
70 | procedure TestDesignPatterns.TearDown;
71 | begin
72 | FreeAndNil(FPrototypeFactory);
73 | FreeAndNil(FVehicleFactory);
74 | end;
75 |
76 | procedure TestDesignPatterns.TestFactory;
77 | var
78 | vehicle : IAbstractVehicle;
79 | begin
80 | vehicle := FVehicleFactory.CreateCar;
81 | CheckTrue(vehicle.ToString() = 'Car', 'Instance is not correct');
82 | vehicle := FVehicleFactory.CreateTruck;
83 | CheckTrue(vehicle.ToString() = 'Truck', 'Instance is not correct');
84 | vehicle := FVehicleFactory.CreateBus;
85 | CheckTrue(vehicle.ToString() = 'Bus', 'Instance is not correct');
86 | vehicle := FVehicleFactory.CreateVan;
87 | CheckTrue(vehicle.ToString() = 'Van', 'Instance is not correct');
88 | end;
89 |
90 | procedure TestDesignPatterns.TestMakeObject;
91 | var
92 | ReturnValue: IVehicle;
93 | Vehicle: string;
94 | begin
95 | Vehicle := 'Car';
96 | ReturnValue := FPrototypeFactory.MakeObject(Vehicle);
97 | CheckTrue(ReturnValue.ToString() = Vehicle, 'This is not the same vehicle');
98 | Vehicle := 'Truck';
99 | ReturnValue := FPrototypeFactory.MakeObject(Vehicle);
100 | CheckTrue(ReturnValue.ToString() = Vehicle, 'This is not the same vehicle');
101 | Vehicle := 'Bus';
102 | ReturnValue := FPrototypeFactory.MakeObject(Vehicle);
103 | CheckTrue(ReturnValue.ToString() = Vehicle, 'This is not the same vehicle');
104 | Vehicle := 'Van';
105 | ReturnValue := FPrototypeFactory.MakeObject(Vehicle);
106 | CheckTrue(ReturnValue.ToString() = Vehicle, 'This is not the same vehicle');
107 | end;
108 |
109 | initialization
110 | // Register any test cases with the test runner
111 | RegisterTest(TestDesignPatterns.Suite);
112 | end.
113 |
114 |
--------------------------------------------------------------------------------
/DUnit/Design Patterns/coverage.ec:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Design Patterns/coverage.ec
--------------------------------------------------------------------------------
/DUnit/Design Patterns/coverage.em:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Design Patterns/coverage.em
--------------------------------------------------------------------------------
/DUnit/Design Patterns/coverage.es:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Design Patterns/coverage.es
--------------------------------------------------------------------------------
/DUnit/Design Patterns/coverage/_files/0.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Design Patterns/coverage/_files/0.html
--------------------------------------------------------------------------------
/DUnit/Design Patterns/coverage/_files/1.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Design Patterns/coverage/_files/1.html
--------------------------------------------------------------------------------
/DUnit/Design Patterns/coverage/_files/2.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Design Patterns/coverage/_files/2.html
--------------------------------------------------------------------------------
/DUnit/Design Patterns/coverage/_files/3.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Design Patterns/coverage/_files/3.html
--------------------------------------------------------------------------------
/DUnit/Design Patterns/coverage/index.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Design Patterns/coverage/index.html
--------------------------------------------------------------------------------
/DUnit/Design Patterns/dcov_emma.bat:
--------------------------------------------------------------------------------
1 | java -cp emma.jar emma report -r html -in coverage.em,coverage.ec
--------------------------------------------------------------------------------
/DUnit/Design Patterns/dcov_execute.bat:
--------------------------------------------------------------------------------
1 | CodeCoverage.exe -e "thundax.DesignPatternsTest.exe" -m "thundax.DesignPatternsTest.map" -ife -uf dcov_units.lst -spf dcov_paths.lst -od ".\" -lt -html -xml -emma -meta
2 |
--------------------------------------------------------------------------------
/DUnit/Design Patterns/dcov_paths.lst:
--------------------------------------------------------------------------------
1 | C:\Desk\OpenSource Projects\ThundaxDelphiRepository\thundax-delphi-personal-repository\src\Design Patterns\AbstractFactory
2 | C:\Desk\OpenSource Projects\ThundaxDelphiRepository\thundax-delphi-personal-repository\src\Design Patterns\Prototype
3 |
--------------------------------------------------------------------------------
/DUnit/Design Patterns/dcov_units.lst:
--------------------------------------------------------------------------------
1 | thundax.Prototype
2 | thundax.AbstractFactory
--------------------------------------------------------------------------------
/DUnit/Design Patterns/dunit.ini:
--------------------------------------------------------------------------------
1 | [GUITestRunner Config]
2 | AutoSave=1
3 | Left=100
4 | Top=163
5 | Width=388
6 | Height=452
7 | Maximized=0
8 | UseRegistry=0
9 | ResultsPanel.Height=174
10 | ErrorMessage.Height=75
11 | ErrorMessage.Visible=1
12 | FailureList.ColumnWidth[0]=120
13 | FailureList.ColumnWidth[1]=100
14 | FailureList.ColumnWidth[2]=200
15 | FailureList.ColumnWidth[3]=-60
16 | HideTestNodesOnOpen=0
17 | BreakOnFailures=0
18 | FailOnNoChecksExecuted=0
19 | FailOnMemoryLeaked=0
20 | IgnoreSetUpTearDownLeaks=0
21 | ReportMemoryLeakTypes=0
22 | SelectTestedNode=1
23 | WarnOnFailTestOverride=0
24 | PopupX=350
25 | PopupY=30
26 |
27 | [Tests.thundax.DesignPatternsTest.exe.TestDesignPatterns]
28 |
29 |
--------------------------------------------------------------------------------
/DUnit/Design Patterns/emma.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Design Patterns/emma.jar
--------------------------------------------------------------------------------
/DUnit/Design Patterns/thundax.DesignPatternsTest.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.DesignPatternsTest;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.Prototype in '..\..\src\Design Patterns\Prototype\thundax.Prototype.pas',
50 | Testthundax.DesignPatterns in 'Testthundax.DesignPatterns.pas',
51 | thundax.AbstractFactory in '..\..\src\Design Patterns\AbstractFactory\thundax.AbstractFactory.pas';
52 |
53 | {$R *.RES}
54 |
55 | begin
56 | Application.Initialize;
57 | ReportMemoryLeaksOnShutdown := True;
58 | if IsConsole then
59 | with TextTestRunner.RunRegisteredTests do
60 | Free
61 | else
62 | GUITestRunner.RunRegisteredTests;
63 | end.
64 |
65 |
--------------------------------------------------------------------------------
/DUnit/Design Patterns/thundax.DesignPatternsTest_10.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.DesignPatternsTest_10;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.Prototype in '..\..\src\Design Patterns\Prototype\thundax.Prototype.pas',
50 | Testthundax.DesignPatterns in 'Testthundax.DesignPatterns.pas',
51 | thundax.AbstractFactory in '..\..\src\Design Patterns\AbstractFactory\thundax.AbstractFactory.pas';
52 |
53 | {$R *.RES}
54 |
55 | begin
56 | Application.Initialize;
57 | ReportMemoryLeaksOnShutdown := True;
58 | if IsConsole then
59 | with TextTestRunner.RunRegisteredTests do
60 | Free
61 | else
62 | GUITestRunner.RunRegisteredTests;
63 | end.
64 |
65 |
--------------------------------------------------------------------------------
/DUnit/Design Patterns/thundax.DesignPatternsTest_10.dproj.local:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2017/05/19 19:12:44.000.246,C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Design Patterns\thundax.DesignPatternsTest.dproj=C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Design Patterns\thundax.DesignPatternsTest_10.dproj
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DUnit/Design Patterns/thundax.DesignPatternsTest_10.identcache:
--------------------------------------------------------------------------------
1 | sC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Design Patterns\Testthundax.DesignPatterns.pas vC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Design Patterns\thundax.DesignPatternsTest_10.dpr rC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\Design Patterns\Prototype\thundax.Prototype.pas ~C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\Design Patterns\AbstractFactory\thundax.AbstractFactory.pas
--------------------------------------------------------------------------------
/DUnit/Design Patterns/thundax.DesignPatternsTest_10.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Design Patterns/thundax.DesignPatternsTest_10.res
--------------------------------------------------------------------------------
/DUnit/Fluent Interfaces/dunit.ini:
--------------------------------------------------------------------------------
1 | [GUITestRunner Config]
2 | AutoSave=1
3 | Left=281
4 | Top=94
5 | Width=500
6 | Height=595
7 | Maximized=0
8 | UseRegistry=0
9 | ResultsPanel.Height=163
10 | ErrorMessage.Height=208
11 | ErrorMessage.Visible=1
12 | FailureList.ColumnWidth[0]=120
13 | FailureList.ColumnWidth[1]=100
14 | FailureList.ColumnWidth[2]=200
15 | FailureList.ColumnWidth[3]=52
16 | HideTestNodesOnOpen=0
17 | BreakOnFailures=0
18 | FailOnNoChecksExecuted=0
19 | FailOnMemoryLeaked=0
20 | IgnoreSetUpTearDownLeaks=0
21 | ReportMemoryLeakTypes=0
22 | SelectTestedNode=1
23 | WarnOnFailTestOverride=0
24 | PopupX=350
25 | PopupY=30
26 |
27 | [Tests.thundax.FluentInterfacesTest.exe.TestTQueryImplementation]
28 |
29 |
--------------------------------------------------------------------------------
/DUnit/Fluent Interfaces/thundax.FluentInterfacesTest.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.FluentInterfacesTest;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.fluentInterface.example in '..\..\src\Fluent Interfaces\thundax.fluentInterface.example.pas',
50 | thundax.fluentInterface.testimplementation in '..\..\src\Fluent Interfaces\thundax.fluentInterface.testimplementation.pas',
51 | Testthundax.fluentInterface in 'Testthundax.fluentInterface.pas';
52 |
53 | {$R *.RES}
54 |
55 | begin
56 | Application.Initialize;
57 | ReportMemoryLeaksOnShutdown := True;
58 | if IsConsole then
59 | with TextTestRunner.RunRegisteredTests do
60 | Free
61 | else
62 | GUITestRunner.RunRegisteredTests;
63 | end.
64 |
65 |
--------------------------------------------------------------------------------
/DUnit/Fluent Interfaces/thundax.FluentInterfacesTest_10.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.FluentInterfacesTest_10;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.fluentInterface.example in '..\..\src\Fluent Interfaces\thundax.fluentInterface.example.pas',
50 | thundax.fluentInterface.testimplementation in '..\..\src\Fluent Interfaces\thundax.fluentInterface.testimplementation.pas',
51 | Testthundax.fluentInterface in 'Testthundax.fluentInterface.pas';
52 |
53 | {$R *.RES}
54 |
55 | begin
56 | Application.Initialize;
57 | ReportMemoryLeaksOnShutdown := True;
58 | if IsConsole then
59 | with TextTestRunner.RunRegisteredTests do
60 | Free
61 | else
62 | GUITestRunner.RunRegisteredTests;
63 | end.
64 |
65 |
--------------------------------------------------------------------------------
/DUnit/Fluent Interfaces/thundax.FluentInterfacesTest_10.dproj.local:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2017/05/19 19:12:43.000.499,C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Fluent Interfaces\thundax.FluentInterfacesTest.dproj=C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Fluent Interfaces\thundax.FluentInterfacesTest_10.dproj
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DUnit/Fluent Interfaces/thundax.FluentInterfacesTest_10.identcache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Fluent Interfaces/thundax.FluentInterfacesTest_10.identcache
--------------------------------------------------------------------------------
/DUnit/Fluent Interfaces/thundax.FluentInterfacesTest_10.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Fluent Interfaces/thundax.FluentInterfacesTest_10.res
--------------------------------------------------------------------------------
/DUnit/Logging/Debug/Win32/dunit.ini:
--------------------------------------------------------------------------------
1 | [GUITestRunner Config]
2 | AutoSave=1
3 | Left=50
4 | Top=50
5 | Width=508
6 | Height=504
7 | Maximized=0
8 | UseRegistry=0
9 | ResultsPanel.Height=174
10 | ErrorMessage.Height=75
11 | ErrorMessage.Visible=1
12 | FailureList.ColumnWidth[0]=120
13 | FailureList.ColumnWidth[1]=100
14 | FailureList.ColumnWidth[2]=200
15 | FailureList.ColumnWidth[3]=60
16 | HideTestNodesOnOpen=0
17 | BreakOnFailures=0
18 | FailOnNoChecksExecuted=0
19 | FailOnMemoryLeaked=0
20 | IgnoreSetUpTearDownLeaks=0
21 | ReportMemoryLeakTypes=0
22 | SelectTestedNode=1
23 | WarnOnFailTestOverride=0
24 | PopupX=350
25 | PopupY=30
26 |
27 |
--------------------------------------------------------------------------------
/DUnit/Logging/Debug/Win32/logTestFile.txt:
--------------------------------------------------------------------------------
1 | 17/02/13 22:20:14 Log this!
2 |
--------------------------------------------------------------------------------
/DUnit/Logging/Testthundax.logging.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit Testthundax.logging;
29 | {
30 |
31 | Delphi DUnit Test Case
32 | ----------------------
33 | This unit contains a skeleton test case class generated by the Test Case Wizard.
34 | Modify the generated code to correctly setup and call the methods from the unit
35 | being tested.
36 |
37 | }
38 |
39 | interface
40 |
41 | uses
42 | TestFramework, thundax.logging;
43 |
44 | type
45 | // Test methods for class TLog
46 |
47 | TestTLog = class(TTestCase)
48 | strict private
49 | FLog: TLog;
50 | public
51 | procedure SetUp; override;
52 | procedure TearDown; override;
53 | published
54 | procedure TestPrint;
55 | end;
56 |
57 | const
58 | Path = 'logTestFile.txt';
59 |
60 | implementation
61 |
62 | uses
63 | SysUtils, Windows;
64 |
65 | procedure TestTLog.SetUp;
66 | begin
67 | if fileExists(Path) then
68 | DeleteFile(PChar(Path));
69 | FLog := TLog.Start(Path, true);
70 | end;
71 |
72 | procedure TestTLog.TearDown;
73 | begin
74 | FLog.Free;
75 | FLog := nil;
76 | end;
77 |
78 | procedure TestTLog.TestPrint;
79 | var
80 | msg: string;
81 | begin
82 | msg := 'Log this!';
83 | FLog.Print(msg);
84 | CheckTrue(FileExists(Path), 'Error, File was not created');
85 | end;
86 |
87 | initialization
88 | RegisterTest(TestTLog.Suite);
89 | end.
90 |
91 |
--------------------------------------------------------------------------------
/DUnit/Logging/dunit.ini:
--------------------------------------------------------------------------------
1 | [GUITestRunner Config]
2 | AutoSave=1
3 | Left=50
4 | Top=50
5 | Width=508
6 | Height=504
7 | Maximized=0
8 | UseRegistry=0
9 | ResultsPanel.Height=174
10 | ErrorMessage.Height=75
11 | ErrorMessage.Visible=1
12 | FailureList.ColumnWidth[0]=120
13 | FailureList.ColumnWidth[1]=100
14 | FailureList.ColumnWidth[2]=200
15 | FailureList.ColumnWidth[3]=60
16 | HideTestNodesOnOpen=0
17 | BreakOnFailures=0
18 | FailOnNoChecksExecuted=0
19 | FailOnMemoryLeaked=0
20 | IgnoreSetUpTearDownLeaks=0
21 | ReportMemoryLeakTypes=0
22 | SelectTestedNode=1
23 | WarnOnFailTestOverride=0
24 | PopupX=350
25 | PopupY=30
26 |
27 |
--------------------------------------------------------------------------------
/DUnit/Logging/logTestFile.txt:
--------------------------------------------------------------------------------
1 | 13/01/13 23:07:27 Log this!
2 |
--------------------------------------------------------------------------------
/DUnit/Logging/thundax.LoggingTest.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.LoggingTest;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.logging in '..\..\src\Logging\thundax.logging.pas',
50 | Testthundax.logging in 'Testthundax.logging.pas';
51 |
52 | {R *.RES}
53 |
54 | begin
55 | Application.Initialize;
56 | ReportMemoryLeaksOnShutdown := True;
57 | if IsConsole then
58 | with TextTestRunner.RunRegisteredTests do
59 | Free
60 | else
61 | GUITestRunner.RunRegisteredTests;
62 | end.
63 |
64 |
--------------------------------------------------------------------------------
/DUnit/Logging/thundax.LoggingTest.dproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {BA321C58-89D7-4ED8-930F-0DF0335B2502}
4 | thundax.LoggingTest.dpr
5 | 12.2
6 | True
7 | Debug
8 | Win32
9 | Application
10 | VCL
11 | DCC32
12 |
13 |
14 | true
15 |
16 |
17 | true
18 | Base
19 | true
20 |
21 |
22 | true
23 | Base
24 | true
25 |
26 |
27 | $(BDS)\Source\DUnit\src;$(DCC_UnitSearchPath)
28 | 00400000
29 | .\$(Config)\$(Platform)
30 | WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;$(DCC_UnitAlias)
31 | _CONSOLE_TESTRUNNER;$(DCC_Define)
32 | .
33 | false
34 | false
35 | false
36 | false
37 | false
38 |
39 |
40 | false
41 | DEBUG;$(DCC_Define)
42 | dcu\
43 | true
44 |
45 |
46 | false
47 | RELEASE;$(DCC_Define)
48 | 0
49 | false
50 |
51 |
52 |
53 | MainSource
54 |
55 |
56 |
57 |
58 | Cfg_2
59 | Base
60 |
61 |
62 | Base
63 |
64 |
65 | Cfg_1
66 | Base
67 |
68 |
69 |
70 |
71 |
72 | Delphi.Personality.12
73 |
74 |
75 |
76 |
77 | False
78 | False
79 | 1
80 | 0
81 | 0
82 | 0
83 | False
84 | False
85 | False
86 | False
87 | False
88 | 2057
89 | 1252
90 |
91 |
92 |
93 |
94 | 1.0.0.0
95 |
96 |
97 |
98 |
99 |
100 | 1.0.0.0
101 |
102 |
103 |
104 | thundax.LoggingTest.dpr
105 |
106 |
107 |
108 | True
109 |
110 |
111 | 12
112 |
113 |
114 |
--------------------------------------------------------------------------------
/DUnit/Logging/thundax.LoggingTest_10.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.LoggingTest_10;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.logging in '..\..\src\Logging\thundax.logging.pas',
50 | Testthundax.logging in 'Testthundax.logging.pas';
51 |
52 | {R *.RES}
53 |
54 | begin
55 | Application.Initialize;
56 | ReportMemoryLeaksOnShutdown := True;
57 | if IsConsole then
58 | with TextTestRunner.RunRegisteredTests do
59 | Free
60 | else
61 | GUITestRunner.RunRegisteredTests;
62 | end.
63 |
64 |
--------------------------------------------------------------------------------
/DUnit/Logging/thundax.LoggingTest_10.dproj.local:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2017/05/19 19:12:43.000.940,C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Logging\thundax.LoggingTest.dproj=C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Logging\thundax.LoggingTest_10.dproj
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DUnit/Logging/thundax.LoggingTest_10.identcache:
--------------------------------------------------------------------------------
1 | ^C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\Logging\thundax.logging.pas gC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Logging\thundax.LoggingTest_10.dpr dC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Logging\Testthundax.logging.pas
--------------------------------------------------------------------------------
/DUnit/Logging/thundax.LoggingTest_10.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Logging/thundax.LoggingTest_10.res
--------------------------------------------------------------------------------
/DUnit/Mock/TestThundax.mock.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit TestThundax.mock;
29 | {
30 |
31 | Delphi DUnit Test Case
32 | ----------------------
33 | This unit contains a skeleton test case class generated by the Test Case Wizard.
34 | Modify the generated code to correctly setup and call the methods from the unit
35 | being tested.
36 |
37 | }
38 |
39 | interface
40 |
41 | uses
42 | TestFramework, thundax.mock.example, thundax.mock;
43 |
44 | type
45 | // Test methods for class TProtocolServer
46 |
47 | TestTProtocolServer = class(TTestCase)
48 | strict private
49 | FProtocolServer: TProtocolServer;
50 | published
51 | procedure TestCommunicate;
52 | procedure TestCommunicateWithMock;
53 | end;
54 |
55 | implementation
56 |
57 | procedure TestTProtocolServer.TestCommunicate;
58 | var
59 | ReturnValue: Boolean;
60 | Server: IServer;
61 | begin
62 | Server := TServer.Create;
63 | FProtocolServer := TProtocolServer.Create(Server);
64 | try
65 | ReturnValue := FProtocolServer.Communicate;
66 | CheckTrue(ReturnValue, 'Communication with the Server Failed');
67 | finally
68 | FProtocolServer.Free;
69 | FProtocolServer := nil;
70 | end;
71 | end;
72 |
73 | procedure TestTProtocolServer.TestCommunicateWithMock;
74 | var
75 | ReturnValue: Boolean;
76 | Server: IServer;
77 | mock : TMock>;
78 | begin
79 | Server := TServer.Create;
80 |
81 | mock := TMock>.Create(Server);
82 |
83 | //Set up the mocking methods using delegates:
84 |
85 | mock.SetUp().SendMessage := (function (message : string) : boolean
86 | begin
87 | result := True; //Return always true whatever the message is
88 | end);
89 |
90 | mock.SetUp().ReceiveMessage := (function () : string
91 | begin
92 | //Return the same message the server would reply
93 | result := 'This is the message from the server!';
94 | end);
95 |
96 | FProtocolServer := TProtocolServer.Create(mock.SetUp());
97 | try
98 | ReturnValue := FProtocolServer.Communicate;
99 | CheckTrue(ReturnValue, 'Communication with the Server Failed');
100 | finally
101 | Server := nil;
102 | mock.Free;
103 | FProtocolServer.Free;
104 | FProtocolServer := nil;
105 | end;
106 | end;
107 |
108 | initialization
109 |
110 | // Register any test cases with the test runner
111 | ReportMemoryLeaksOnShutdown := true;
112 | RegisterTest(TestTProtocolServer.Suite);
113 |
114 | end.
115 |
--------------------------------------------------------------------------------
/DUnit/Mock/dunit.ini:
--------------------------------------------------------------------------------
1 | [GUITestRunner Config]
2 | AutoSave=1
3 | Left=22
4 | Top=22
5 | Width=500
6 | Height=500
7 | Maximized=0
8 | UseRegistry=0
9 | ResultsPanel.Height=174
10 | ErrorMessage.Height=75
11 | ErrorMessage.Visible=1
12 | FailureList.ColumnWidth[0]=120
13 | FailureList.ColumnWidth[1]=100
14 | FailureList.ColumnWidth[2]=200
15 | FailureList.ColumnWidth[3]=52
16 | HideTestNodesOnOpen=0
17 | BreakOnFailures=0
18 | FailOnNoChecksExecuted=0
19 | FailOnMemoryLeaked=0
20 | IgnoreSetUpTearDownLeaks=0
21 | ReportMemoryLeakTypes=0
22 | SelectTestedNode=1
23 | WarnOnFailTestOverride=0
24 | PopupX=350
25 | PopupY=30
26 |
27 |
--------------------------------------------------------------------------------
/DUnit/Mock/thundax.MockTest.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.MockTest;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.mock in '..\..\src\Mock\thundax.mock.pas',
50 | thundax.mock.example in '..\..\src\Mock\thundax.mock.example.pas',
51 | TestThundax.mock in 'TestThundax.mock.pas';
52 |
53 | {R *.RES}
54 |
55 | begin
56 | Application.Initialize;
57 | ReportMemoryLeaksOnShutdown := True;
58 | if IsConsole then
59 | with TextTestRunner.RunRegisteredTests do
60 | Free
61 | else
62 | GUITestRunner.RunRegisteredTests;
63 | end.
64 |
65 |
--------------------------------------------------------------------------------
/DUnit/Mock/thundax.MockTest_10.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.MockTest_10;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.mock in '..\..\src\Mock\thundax.mock.pas',
50 | thundax.mock.example in '..\..\src\Mock\thundax.mock.example.pas',
51 | TestThundax.mock in 'TestThundax.mock.pas';
52 |
53 | {R *.RES}
54 |
55 | begin
56 | Application.Initialize;
57 | ReportMemoryLeaksOnShutdown := True;
58 | if IsConsole then
59 | with TextTestRunner.RunRegisteredTests do
60 | Free
61 | else
62 | GUITestRunner.RunRegisteredTests;
63 | end.
64 |
65 |
--------------------------------------------------------------------------------
/DUnit/Mock/thundax.MockTest_10.dproj.local:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2017/05/19 19:12:41.000.428,C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Mock\thundax.MockTest.dproj=C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Mock\thundax.MockTest_10.dproj
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DUnit/Mock/thundax.MockTest_10.identcache:
--------------------------------------------------------------------------------
1 | ^C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Mock\TestThundax.mock.pas XC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\Mock\thundax.mock.pas aC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Mock\thundax.MockTest_10.dpr `C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\Mock\thundax.mock.example.pas
--------------------------------------------------------------------------------
/DUnit/Mock/thundax.MockTest_10.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Mock/thundax.MockTest_10.res
--------------------------------------------------------------------------------
/DUnit/Mock/thundax.MockTest_10.stat:
--------------------------------------------------------------------------------
1 | [Stats]
2 | EditorSecs=11
3 | DesignerSecs=1
4 | InspectorSecs=1
5 | CompileSecs=29856
6 | OtherSecs=11
7 | StartTime=19/05/2017 19:03:50
8 | RealKeys=0
9 | EffectiveKeys=0
10 | DebugSecs=1
11 |
--------------------------------------------------------------------------------
/DUnit/Multi-Threading/Testthundax.Multithreading.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit Testthundax.Multithreading;
29 | {
30 |
31 | Delphi DUnit Test Case
32 | ----------------------
33 | This unit contains a skeleton test case class generated by the Test Case Wizard.
34 | Modify the generated code to correctly setup and call the methods from the unit
35 | being tested.
36 |
37 | }
38 |
39 | interface
40 |
41 | uses
42 | TestFramework, thundax.Multithreading.example;
43 |
44 | type
45 | // Test methods for class TBruteForceThreading
46 |
47 | TestTBruteForceThreading = class(TTestCase)
48 | public
49 | procedure SetUp; override;
50 | procedure TearDown; override;
51 | published
52 | procedure TestSolve;
53 | end;
54 |
55 | implementation
56 |
57 | procedure TestTBruteForceThreading.SetUp;
58 | begin
59 | //
60 | end;
61 |
62 | procedure TestTBruteForceThreading.TearDown;
63 | begin
64 | //
65 | end;
66 |
67 | procedure TestTBruteForceThreading.TestSolve;
68 | var
69 | ReturnValue: string;
70 | Hash : string;
71 | BruteForce : TBruteForceThreading;
72 | begin
73 | Hash := TBruteForceThreading.md5('deal');
74 | BruteForce := TBruteForceThreading.new(Hash);
75 | ReturnValue := BruteForce.solve;
76 | CheckTrue(ReturnValue = 'deal', 'Word has not been found');
77 | BruteForce.Free;
78 |
79 | Hash := TBruteForceThreading.md5('zzzz');
80 | BruteForce := TBruteForceThreading.new(Hash);
81 | ReturnValue := BruteForce.solve;
82 | CheckTrue(ReturnValue = 'zzzz', 'Word has not been found');
83 | BruteForce.Free;
84 | end;
85 |
86 | initialization
87 | // Register any test cases with the test runner
88 | RegisterTest(TestTBruteForceThreading.Suite);
89 | end.
90 |
91 |
--------------------------------------------------------------------------------
/DUnit/Multi-Threading/dunit.ini:
--------------------------------------------------------------------------------
1 | [GUITestRunner Config]
2 | AutoSave=1
3 | Left=25
4 | Top=25
5 | Width=772
6 | Height=504
7 | Maximized=0
8 | UseRegistry=0
9 | ResultsPanel.Height=174
10 | ErrorMessage.Height=75
11 | ErrorMessage.Visible=1
12 | FailureList.ColumnWidth[0]=120
13 | FailureList.ColumnWidth[1]=100
14 | FailureList.ColumnWidth[2]=200
15 | FailureList.ColumnWidth[3]=324
16 | HideTestNodesOnOpen=0
17 | BreakOnFailures=0
18 | FailOnNoChecksExecuted=0
19 | FailOnMemoryLeaked=0
20 | IgnoreSetUpTearDownLeaks=0
21 | ReportMemoryLeakTypes=0
22 | SelectTestedNode=1
23 | WarnOnFailTestOverride=0
24 | PopupX=350
25 | PopupY=30
26 |
27 |
--------------------------------------------------------------------------------
/DUnit/Multi-Threading/thundax.MultiThreadingTest.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.MultiThreadingTest;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.Multithreading.example in '..\..\src\Multi-Threading\thundax.Multithreading.example.pas',
50 | Testthundax.Multithreading in 'Testthundax.Multithreading.pas';
51 |
52 | {$R *.RES}
53 |
54 | begin
55 | Application.Initialize;
56 | ReportMemoryLeaksOnShutdown := True;
57 | if IsConsole then
58 | with TextTestRunner.RunRegisteredTests do
59 | Free
60 | else
61 | GUITestRunner.RunRegisteredTests;
62 | end.
63 |
64 |
--------------------------------------------------------------------------------
/DUnit/Multi-Threading/thundax.MultiThreadingTest_10.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.MultiThreadingTest_10;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.Multithreading.example in '..\..\src\Multi-Threading\thundax.Multithreading.example.pas',
50 | Testthundax.Multithreading in 'Testthundax.Multithreading.pas';
51 |
52 | {$R *.RES}
53 |
54 | begin
55 | Application.Initialize;
56 | ReportMemoryLeaksOnShutdown := True;
57 | if IsConsole then
58 | with TextTestRunner.RunRegisteredTests do
59 | Free
60 | else
61 | GUITestRunner.RunRegisteredTests;
62 | end.
63 |
64 |
--------------------------------------------------------------------------------
/DUnit/Multi-Threading/thundax.MultiThreadingTest_10.dproj.local:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2017/05/19 19:12:47.000.083,C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Multi-Threading\thundax.MultiThreadingTest.dproj=C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Multi-Threading\thundax.MultiThreadingTest_10.dproj
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DUnit/Multi-Threading/thundax.MultiThreadingTest_10.identcache:
--------------------------------------------------------------------------------
1 | sC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Multi-Threading\Testthundax.Multithreading.pas uC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\Multi-Threading\thundax.Multithreading.example.pas vC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Multi-Threading\thundax.MultiThreadingTest_10.dpr
--------------------------------------------------------------------------------
/DUnit/Multi-Threading/thundax.MultiThreadingTest_10.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Multi-Threading/thundax.MultiThreadingTest_10.res
--------------------------------------------------------------------------------
/DUnit/Multi-Threading/thundax.MultiThreadingTest_10.stat:
--------------------------------------------------------------------------------
1 | [Stats]
2 | EditorSecs=68
3 | DesignerSecs=1
4 | InspectorSecs=1
5 | CompileSecs=33211
6 | OtherSecs=46
7 | StartTime=19/05/2017 19:04:10
8 | RealKeys=0
9 | EffectiveKeys=0
10 | DebugSecs=1
11 |
--------------------------------------------------------------------------------
/DUnit/Profiler/thundax.ProfilerTest.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.ProfilerTest;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner;
49 |
50 | {$R *.RES}
51 |
52 | begin
53 | Application.Initialize;
54 | ReportMemoryLeaksOnShutdown := True;
55 | if IsConsole then
56 | with TextTestRunner.RunRegisteredTests do
57 | Free
58 | else
59 | GUITestRunner.RunRegisteredTests;
60 | end.
61 |
62 |
--------------------------------------------------------------------------------
/DUnit/Profiler/thundax.ProfilerTest.dproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {FE571845-4505-4632-B1C5-4D2DC9249096}
4 | thundax.ProfilerTest.dpr
5 | 12.2
6 | True
7 | Debug
8 | Win32
9 | Application
10 | VCL
11 | DCC32
12 |
13 |
14 | true
15 |
16 |
17 | true
18 | Base
19 | true
20 |
21 |
22 | true
23 | Base
24 | true
25 |
26 |
27 | $(BDS)\Source\DUnit\src;$(DCC_UnitSearchPath)
28 | 00400000
29 | .\$(Config)\$(Platform)
30 | WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;$(DCC_UnitAlias)
31 | _CONSOLE_TESTRUNNER;$(DCC_Define)
32 | .
33 | false
34 | false
35 | false
36 | false
37 | false
38 |
39 |
40 | false
41 | DEBUG;$(DCC_Define)
42 | .
43 | dcu\
44 | true
45 |
46 |
47 | false
48 | RELEASE;$(DCC_Define)
49 | 0
50 | false
51 |
52 |
53 |
54 | MainSource
55 |
56 |
57 | Cfg_2
58 | Base
59 |
60 |
61 | Base
62 |
63 |
64 | Cfg_1
65 | Base
66 |
67 |
68 |
69 |
70 |
71 | Delphi.Personality.12
72 |
73 |
74 |
75 |
76 | False
77 | False
78 | 1
79 | 0
80 | 0
81 | 0
82 | False
83 | False
84 | False
85 | False
86 | False
87 | 2057
88 | 1252
89 |
90 |
91 |
92 |
93 | 1.0.0.0
94 |
95 |
96 |
97 |
98 |
99 | 1.0.0.0
100 |
101 |
102 |
103 | thundax.ProfilerTest.dpr
104 |
105 |
106 |
107 | True
108 |
109 |
110 | 12
111 |
112 |
113 |
--------------------------------------------------------------------------------
/DUnit/Profiler/thundax.ProfilerTest_10.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.ProfilerTest_10;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner;
49 |
50 | {$R *.RES}
51 |
52 | begin
53 | Application.Initialize;
54 | ReportMemoryLeaksOnShutdown := True;
55 | if IsConsole then
56 | with TextTestRunner.RunRegisteredTests do
57 | Free
58 | else
59 | GUITestRunner.RunRegisteredTests;
60 | end.
61 |
62 |
--------------------------------------------------------------------------------
/DUnit/Profiler/thundax.ProfilerTest_10.dproj.local:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2017/05/19 19:12:47.000.115,C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Profiler\thundax.ProfilerTest.dproj=C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Profiler\thundax.ProfilerTest_10.dproj
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DUnit/Profiler/thundax.ProfilerTest_10.identcache:
--------------------------------------------------------------------------------
1 | iC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Profiler\thundax.ProfilerTest_10.dpr
--------------------------------------------------------------------------------
/DUnit/Profiler/thundax.ProfilerTest_10.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Profiler/thundax.ProfilerTest_10.res
--------------------------------------------------------------------------------
/DUnit/Refactoring/Refactoring.pptx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Refactoring/Refactoring.pptx
--------------------------------------------------------------------------------
/DUnit/Refactoring/Testthundax.refactoring.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2017, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit Testthundax.refactoring;
29 | {
30 |
31 | Delphi DUnit Test Case
32 | ----------------------
33 | This unit contains a skeleton test case class generated by the Test Case Wizard.
34 | Modify the generated code to correctly setup and call the methods from the unit
35 | being tested.
36 |
37 | }
38 |
39 | interface
40 |
41 | uses
42 | TestFramework, thundax.refactoring.example, generics.collections;
43 |
44 | type
45 | // Test methods for class TSQL
46 |
47 | TestTSQL = class(TTestCase)
48 | public
49 | procedure SetUp; override;
50 | procedure TearDown; override;
51 | published
52 | procedure TestGetQuery;
53 | procedure TestGetQueryImperativeRefactoring;
54 | procedure TestGetQueryInlineRefactoring;
55 | procedure TestGetQueryFuncInlineRefactoring;
56 | end;
57 |
58 | implementation
59 |
60 | procedure TestTSQL.SetUp;
61 | begin
62 |
63 | end;
64 |
65 | procedure TestTSQL.TearDown;
66 | begin
67 |
68 | end;
69 |
70 | procedure TestTSQL.TestgetQuery;
71 | var
72 | myQuery : TMyQuery;
73 | urlList : TList;
74 | begin
75 | myQuery := TMyQuery.create();
76 | try
77 | urlList := myQuery.Results('https://www.google.co.uk');
78 | checkTrue(urlList.Count > 0, 'Error list should not be empty');
79 | urlList.Free;
80 | finally
81 | myQuery.Free;
82 | end;
83 | end;
84 |
85 | procedure TestTSQL.TestGetQueryFuncInlineRefactoring;
86 | var
87 | myQuery : TMyQuery;
88 | urlList : TList;
89 | begin
90 | myQuery := TMyQuery.create();
91 | try
92 | urlList := myQuery.ResultsFuncInlineRefactoring('https://www.google.co.uk');
93 | checkTrue(urlList.Count > 0, 'Error list should not be empty');
94 | urlList.Free;
95 | finally
96 | myQuery.Free;
97 | end;
98 | end;
99 |
100 | procedure TestTSQL.TestGetQueryImperativeRefactoring;
101 | var
102 | myQuery : TMyQuery;
103 | urlList : TList;
104 | begin
105 | myQuery := TMyQuery.create();
106 | try
107 | urlList := myQuery.ResultsImperativeRefactoring('https://www.google.co.uk');
108 | checkTrue(urlList.Count > 0, 'Error list should not be empty');
109 | urlList.Free;
110 | finally
111 | myQuery.Free;
112 | end;
113 | end;
114 |
115 | procedure TestTSQL.TestGetQueryInlineRefactoring;
116 | var
117 | myQuery : TMyQuery;
118 | urlList : TList;
119 | begin
120 | myQuery := TMyQuery.create();
121 | try
122 | urlList := myQuery.ResultsInlineRefactoring('https://www.google.co.uk');
123 | checkTrue(urlList.Count > 0, 'Error list should not be empty');
124 | urlList.Free;
125 | finally
126 | myQuery.Free;
127 | end;
128 | end;
129 |
130 | initialization
131 | // Register any test cases with the test runner
132 | RegisterTest(TestTSQL.Suite);
133 | end.
134 |
--------------------------------------------------------------------------------
/DUnit/Refactoring/thundax.Refactoring_10.dpr:
--------------------------------------------------------------------------------
1 | program thundax.Refactoring_10;
2 | {
3 |
4 | Delphi DUnit Test Project
5 | -------------------------
6 | This project contains the DUnit test framework and the GUI/Console test runners.
7 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
8 | to use the console test runner. Otherwise the GUI test runner will be used by
9 | default.
10 |
11 | }
12 |
13 | {$IFDEF CONSOLE_TESTRUNNER}
14 | {$APPTYPE CONSOLE}
15 | {$ENDIF}
16 |
17 | uses
18 | Forms,
19 | TestFramework,
20 | GUITestRunner,
21 | TextTestRunner,
22 | thundax.refactoring.example in '..\..\src\Refactoring\thundax.refactoring.example.pas',
23 | Testthundax.refactoring in 'Testthundax.refactoring.pas';
24 |
25 | {$R *.RES}
26 |
27 | begin
28 | Application.Initialize;
29 | ReportMemoryLeaksOnShutdown := true;
30 | if IsConsole then
31 | with TextTestRunner.RunRegisteredTests do
32 | Free
33 | else
34 | GUITestRunner.RunRegisteredTests;
35 | end.
36 |
37 |
--------------------------------------------------------------------------------
/DUnit/Refactoring/thundax.Refactoring_10.dproj.local:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2017/05/19 19:16:33.895,C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Refactoring\thundax.Refactoring_10.dproj=C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Refactoring\thundax.dproj
5 | 2017/05/19 19:54:45.371,=C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\Refactoring\thundax.refactoring.example.pas
6 | 2017/05/19 19:55:58.803,=C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Refactoring\Unit1.pas
7 | 2017/05/19 19:56:20.648,C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Refactoring\Testthundax.refactoring.pas=C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Refactoring\Unit1.pas
8 |
9 |
10 |
--------------------------------------------------------------------------------
/DUnit/Refactoring/thundax.Refactoring_10.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Refactoring/thundax.Refactoring_10.res
--------------------------------------------------------------------------------
/DUnit/Refactoring/thundax.stat:
--------------------------------------------------------------------------------
1 | [Stats]
2 | EditorSecs=1504
3 | DesignerSecs=1
4 | InspectorSecs=5
5 | CompileSecs=38798
6 | OtherSecs=268
7 | StartTime=19/05/2017 19:16:22
8 | RealKeys=0
9 | EffectiveKeys=0
10 | DebugSecs=1116
11 |
--------------------------------------------------------------------------------
/DUnit/Regular Expressions/Testthundax.RegularExpressions.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit Testthundax.RegularExpressions;
29 | {
30 |
31 | Delphi DUnit Test Case
32 | ----------------------
33 | This unit contains a skeleton test case class generated by the Test Case Wizard.
34 | Modify the generated code to correctly setup and call the methods from the unit
35 | being tested.
36 |
37 | }
38 |
39 | interface
40 |
41 | uses
42 | TestFramework, thundax.stringHelper;
43 |
44 | type
45 | TestTStringHelper = class(TTestCase)
46 | public
47 | procedure SetUp; override;
48 | procedure TearDown; override;
49 | published
50 | procedure TestLeftRightString;
51 | procedure TestIsMatchRegularExpression;
52 | procedure TestGroupsRegularExpression;
53 | end;
54 |
55 | implementation
56 |
57 | uses
58 | RegularExpressions;
59 |
60 | procedure TestTStringHelper.SetUp;
61 | begin
62 | //
63 | end;
64 |
65 | procedure TestTStringHelper.TearDown;
66 | begin
67 | //
68 | end;
69 |
70 | procedure TestTStringHelper.TestGroupsRegularExpression;
71 | var
72 | ReturnValue: Integer;
73 | text: string;
74 | group : TGroup;
75 | begin
76 | text := 'ABABABGHIJKL';
77 | ReturnValue := 0;
78 | for group in TStringHelper.New(text).Left(6).Right(4).MatchGroups('(AB)') do
79 | inc(ReturnValue);
80 | CheckTrue(ReturnValue=2, 'ReturnValue does not match');
81 | end;
82 |
83 | procedure TestTStringHelper.TestIsMatchRegularExpression;
84 | var
85 | ReturnValue: boolean;
86 | text: string;
87 | begin
88 | text := 'ABCDEFGHIJKL';
89 | ReturnValue := TStringHelper.New(text).Left(3).Right(1).isMatch('[A-Z]');
90 | CheckTrue(ReturnValue, 'ReturnValue does not match');
91 | end;
92 |
93 | procedure TestTStringHelper.TestLeftRightString;
94 | var
95 | ReturnValue: string;
96 | text: string;
97 | begin
98 | text := 'ABCDEFGHIJKL';
99 | ReturnValue := TStringHelper.New(text).Left(3).Right(1).toString();
100 | CheckTrue(ReturnValue = 'C', 'ReturnValue does not return desired value');
101 | end;
102 |
103 | initialization
104 | RegisterTest(TestTStringHelper.Suite);
105 | end.
106 |
107 |
--------------------------------------------------------------------------------
/DUnit/Regular Expressions/dunit.ini:
--------------------------------------------------------------------------------
1 | [GUITestRunner Config]
2 | AutoSave=1
3 | Left=50
4 | Top=50
5 | Width=508
6 | Height=504
7 | Maximized=0
8 | UseRegistry=0
9 | ResultsPanel.Height=174
10 | ErrorMessage.Height=75
11 | ErrorMessage.Visible=1
12 | FailureList.ColumnWidth[0]=120
13 | FailureList.ColumnWidth[1]=100
14 | FailureList.ColumnWidth[2]=200
15 | FailureList.ColumnWidth[3]=60
16 | HideTestNodesOnOpen=0
17 | BreakOnFailures=0
18 | FailOnNoChecksExecuted=0
19 | FailOnMemoryLeaked=0
20 | IgnoreSetUpTearDownLeaks=0
21 | ReportMemoryLeakTypes=0
22 | SelectTestedNode=1
23 | WarnOnFailTestOverride=0
24 | PopupX=350
25 | PopupY=30
26 |
27 |
--------------------------------------------------------------------------------
/DUnit/Regular Expressions/thundax.RegularExpressionsTest.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.RegularExpressionsTest;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.stringHelper in '..\..\src\Regular Expressions\thundax.stringHelper.pas',
50 | Testthundax.RegularExpressions in 'Testthundax.RegularExpressions.pas',
51 | thundax.stringHelper.contract in '..\..\src\Regular Expressions\thundax.stringHelper.contract.pas';
52 |
53 | {$R *.RES}
54 |
55 | begin
56 | Application.Initialize;
57 | ReportMemoryLeaksOnShutdown := True;
58 | if IsConsole then
59 | with TextTestRunner.RunRegisteredTests do
60 | Free
61 | else
62 | GUITestRunner.RunRegisteredTests;
63 | end.
64 |
65 |
--------------------------------------------------------------------------------
/DUnit/Regular Expressions/thundax.RegularExpressionsTest_10.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.RegularExpressionsTest_10;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.stringHelper in '..\..\src\Regular Expressions\thundax.stringHelper.pas',
50 | Testthundax.RegularExpressions in 'Testthundax.RegularExpressions.pas',
51 | thundax.stringHelper.contract in '..\..\src\Regular Expressions\thundax.stringHelper.contract.pas';
52 |
53 | {$R *.RES}
54 |
55 | begin
56 | Application.Initialize;
57 | ReportMemoryLeaksOnShutdown := True;
58 | if IsConsole then
59 | with TextTestRunner.RunRegisteredTests do
60 | Free
61 | else
62 | GUITestRunner.RunRegisteredTests;
63 | end.
64 |
65 |
--------------------------------------------------------------------------------
/DUnit/Regular Expressions/thundax.RegularExpressionsTest_10.dproj.local:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2017/05/19 19:12:44.000.092,C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Regular Expressions\thundax.RegularExpressionsTest.dproj=C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Regular Expressions\thundax.RegularExpressionsTest_10.dproj
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DUnit/Regular Expressions/thundax.RegularExpressionsTest_10.identcache:
--------------------------------------------------------------------------------
1 | oC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\Regular Expressions\thundax.stringHelper.pas ~C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Regular Expressions\thundax.RegularExpressionsTest_10.dpr xC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\Regular Expressions\thundax.stringHelper.contract.pas {C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\Regular Expressions\Testthundax.RegularExpressions.pas
--------------------------------------------------------------------------------
/DUnit/Regular Expressions/thundax.RegularExpressionsTest_10.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/Regular Expressions/thundax.RegularExpressionsTest_10.res
--------------------------------------------------------------------------------
/DUnit/UML/TestDiagramUML.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/UML/TestDiagramUML.jpg
--------------------------------------------------------------------------------
/DUnit/UML/TestDiagramUML.sdx:
--------------------------------------------------------------------------------
1 | Application:TApplication
2 | MainThread:TThread
3 | thread1:TThread
4 | thread2:TThread
5 | thread3:TThread
6 |
7 | Application:MainThread.Start()
8 | MainThread:DONE(385ms)=thread1.CreateAnonymousThread(37)
9 | MainThread:DONE(799ms)=thread2.CreateAnonymousThread(79)
10 | MainThread:DONE(2923ms)=thread3.CreateAnonymousThread(288)
11 |
--------------------------------------------------------------------------------
/DUnit/UML/dunit.ini:
--------------------------------------------------------------------------------
1 | [GUITestRunner Config]
2 | AutoSave=1
3 | Left=160
4 | Top=185
5 | Width=508
6 | Height=504
7 | Maximized=0
8 | UseRegistry=0
9 | ResultsPanel.Height=174
10 | ErrorMessage.Height=75
11 | ErrorMessage.Visible=1
12 | FailureList.ColumnWidth[0]=120
13 | FailureList.ColumnWidth[1]=100
14 | FailureList.ColumnWidth[2]=200
15 | FailureList.ColumnWidth[3]=60
16 | HideTestNodesOnOpen=0
17 | BreakOnFailures=0
18 | FailOnNoChecksExecuted=0
19 | FailOnMemoryLeaked=0
20 | IgnoreSetUpTearDownLeaks=0
21 | ReportMemoryLeakTypes=0
22 | SelectTestedNode=1
23 | WarnOnFailTestOverride=0
24 | PopupX=350
25 | PopupY=30
26 |
27 | [Tests.thundax.UMLDiagramsTest.exe.TestTUML]
28 |
29 |
--------------------------------------------------------------------------------
/DUnit/UML/thundax.UMLDiagramsTest.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.UMLDiagramsTest;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.UML in '..\..\src\UML\thundax.UML.pas',
50 | Testthundax.UMLDiagrams in 'Testthundax.UMLDiagrams.pas',
51 | Testthundax.classHelper in '..\ClassHelper\Testthundax.classHelper.pas',
52 | thundax.classHelper.example in '..\..\src\ClassHelper\thundax.classHelper.example.pas';
53 |
54 | {$R *.RES}
55 |
56 | begin
57 | Application.Initialize;
58 | ReportMemoryLeaksOnShutdown := True;
59 | if IsConsole then
60 | with TextTestRunner.RunRegisteredTests do
61 | Free
62 | else
63 | GUITestRunner.RunRegisteredTests;
64 | end.
65 |
66 |
--------------------------------------------------------------------------------
/DUnit/UML/thundax.UMLDiagramsTest_10.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | program thundax.UMLDiagramsTest_10;
29 | {
30 |
31 | Delphi DUnit Test Project
32 | -------------------------
33 | This project contains the DUnit test framework and the GUI/Console test runners.
34 | Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
35 | to use the console test runner. Otherwise the GUI test runner will be used by
36 | default.
37 |
38 | }
39 |
40 | {$IFDEF CONSOLE_TESTRUNNER}
41 | {$APPTYPE CONSOLE}
42 | {$ENDIF}
43 |
44 | uses
45 | Forms,
46 | TestFramework,
47 | GUITestRunner,
48 | TextTestRunner,
49 | thundax.UML in '..\..\src\UML\thundax.UML.pas',
50 | Testthundax.UMLDiagrams in 'Testthundax.UMLDiagrams.pas',
51 | Testthundax.classHelper in '..\ClassHelper\Testthundax.classHelper.pas',
52 | thundax.classHelper.example in '..\..\src\ClassHelper\thundax.classHelper.example.pas';
53 |
54 | {$R *.RES}
55 |
56 | begin
57 | Application.Initialize;
58 | ReportMemoryLeaksOnShutdown := True;
59 | if IsConsole then
60 | with TextTestRunner.RunRegisteredTests do
61 | Free
62 | else
63 | GUITestRunner.RunRegisteredTests;
64 | end.
65 |
66 |
--------------------------------------------------------------------------------
/DUnit/UML/thundax.UMLDiagramsTest_10.dproj.local:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2017/05/19 19:12:43.000.780,C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\UML\thundax.UMLDiagramsTest.dproj=C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\UML\thundax.UMLDiagramsTest_10.dproj
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DUnit/UML/thundax.UMLDiagramsTest_10.identcache:
--------------------------------------------------------------------------------
1 | gC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\UML\thundax.UMLDiagramsTest_10.dpr lC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\ClassHelper\Testthundax.classHelper.pas nC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\ClassHelper\thundax.classHelper.example.pas VC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\UML\thundax.UML.pas dC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\UML\Testthundax.UMLDiagrams.pas
--------------------------------------------------------------------------------
/DUnit/UML/thundax.UMLDiagramsTest_10.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/DUnit/UML/thundax.UMLDiagramsTest_10.res
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | bits and pieces from everyday coding
2 | ==============
3 | **Thundax repository contains Delphi examples on:**
4 | - Mock Objects
5 | - Custom Attributes
6 | - Fluent interfaces
7 | - Regular Expressions
8 | - UML Diagrams
9 | - Logging
10 | - Design Patterns
11 | - Code Coverage
12 | - Class Operator
13 | - Class Helper
14 | - Multi-threading
15 | - Anonymous methods
16 | - Unit testing
17 | - Profiling
18 | - Debugging
19 | - Plotting
20 | - Refactoring
21 |
22 | Feel free to use them to improve your applications.
23 |
24 | **Mimicking LINQ:**
25 |
26 | ```delphi
27 | function TQueryImplementation.GetIntegerListQueryValues: TList;
28 | var
29 | IqueryList : IQueryList;
30 | item : integer;
31 | begin
32 | Result := TList.Create;
33 | IqueryList := TQueryList
34 | .New()
35 | .FillList(function ( list : TList ) : Boolean
36 | var k : integer;
37 | begin
38 | for k := 0 to 100 do
39 | list.Add(Random(100));
40 | result := true;
41 | end);
42 |
43 | //Display filtered values
44 | for item in IqueryList
45 | .Select(function ( list : TList ) : TList
46 | var
47 | k : integer;
48 | selectList : TList;
49 | begin
50 | selectList := TList.Create;
51 | for k := 0 to list.Count-1 do
52 | begin
53 | if Abs(list.items[k]) > 0 then
54 | selectList.Add(list.items[k]);
55 | end;
56 | list.Free;
57 | result := selectList;
58 | end)
59 | .Where(function ( i : integer) : Boolean
60 | begin
61 | result := (i > 50);
62 | end)
63 | .Where(function ( i : integer) : Boolean
64 | begin
65 | result := (i < 75);
66 | end)
67 | .OrderBy(TComparer.Construct(
68 | function (const L, R: integer): integer
69 | begin
70 | result := L - R; //Ascending
71 | end
72 | )).Distinct.List do
73 | result.add(item);
74 | end;
75 | ```
76 |
77 | **Example DUnit:**
78 | - 
79 |
80 | **Example using Fluent Interfaces:**
81 | - 
82 |
83 | **Example using Quick Sequence Diagram Editor (sdedit):**
84 | - 
85 |
86 | ## Sponsors
87 | No sponsors yet! Will you be the first?
88 |
89 | [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=L5FCF6LX5C9AW "Donate once-off to this project using Paypal")
90 |
--------------------------------------------------------------------------------
/src/COM/interface/thundax.COMLib.contract.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit thundax.COMLib.contract;
29 |
30 | interface
31 |
32 | const
33 | Class_COMLib: TGUID = '{F1755A6C-284D-400E-BAE2-89CB5F0C6EFD}';
34 | IID_ICOMLib : TGUID = '{F1755A6C-284D-400E-BAE2-89CB5F0C6EFD}';
35 |
36 | type
37 | ICOMLib = interface
38 | ['{F1755A6C-284D-400E-BAE2-89CB5F0C6EFD}']
39 | function Execute(param : string): string; stdcall;
40 | end;
41 |
42 | implementation
43 |
44 | end.
45 |
--------------------------------------------------------------------------------
/src/COM/thundax.COMLib.Instance.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 |
29 | unit thundax.COMLib.Instance;
30 |
31 | interface
32 |
33 | uses
34 | Windows, ActiveX, ComObj, thundax.COMLib.contract;
35 |
36 | type
37 | TCOMLib = class(TComObject, ICOMLib)
38 | protected
39 | function Execute(param : string): string; stdcall;
40 | end;
41 |
42 |
43 | implementation
44 |
45 | uses ComServ;
46 |
47 | { TCOMLib }
48 | {----------------------------------------------------------------------------------}
49 | function TCOMLib.Execute(param : string) : string;
50 | begin
51 | result := 'TCOMLibExample Executed with param: ' + param;
52 | end;
53 | {----------------------------------------------------------------------------------}
54 |
55 | initialization
56 | TComObjectFactory.Create(ComServer, TCOMLib, Class_COMLib, 'COMLib', 'COMLib example', ciMultiInstance, tmApartment);
57 |
58 | end.
59 |
--------------------------------------------------------------------------------
/src/COM/thundax.COMLib.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | library thundax.COMLib;
29 |
30 | { Important note about DLL memory management: ShareMem must be the
31 | first unit in your library's USES clause AND your project's (select
32 | Project-View Source) USES clause if your DLL exports any procedures or
33 | functions that pass strings as parameters or function results. This
34 | applies to all strings passed to and from your DLL--even those that
35 | are nested in records and classes. ShareMem is the interface unit to
36 | the BORLNDMM.DLL shared memory manager, which must be deployed along
37 | with your DLL. To avoid using BORLNDMM.DLL, pass string information
38 | using PChar or ShortString parameters. }
39 |
40 | uses
41 | ComServ,
42 | SysUtils,
43 | Classes,
44 | thundax.COMLib.contract in 'interface\thundax.COMLib.contract.pas',
45 | thundax.COMLib.Instance in 'thundax.COMLib.Instance.pas',
46 | Testthundax.COMLib in '..\..\DUnit\COM\Testthundax.COMLib.pas';
47 |
48 | exports
49 | DllGetClassObject,
50 | DllCanUnloadNow,
51 | DllRegisterServer,
52 | DllUnregisterServer;
53 |
54 | {$R *.res}
55 |
56 | begin
57 | end.
58 |
--------------------------------------------------------------------------------
/src/COM/thundax.COMLib.tlb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/src/COM/thundax.COMLib.tlb
--------------------------------------------------------------------------------
/src/COM/thundax.COMLib_10.dpr:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | library thundax.COMLib_10;
29 |
30 | { Important note about DLL memory management: ShareMem must be the
31 | first unit in your library's USES clause AND your project's (select
32 | Project-View Source) USES clause if your DLL exports any procedures or
33 | functions that pass strings as parameters or function results. This
34 | applies to all strings passed to and from your DLL--even those that
35 | are nested in records and classes. ShareMem is the interface unit to
36 | the BORLNDMM.DLL shared memory manager, which must be deployed along
37 | with your DLL. To avoid using BORLNDMM.DLL, pass string information
38 | using PChar or ShortString parameters. }
39 |
40 | uses
41 | ComServ,
42 | SysUtils,
43 | Classes,
44 | thundax.COMLib.contract in 'interface\thundax.COMLib.contract.pas',
45 | thundax.COMLib.Instance in 'thundax.COMLib.Instance.pas',
46 | Testthundax.COMLib in '..\..\DUnit\COM\Testthundax.COMLib.pas';
47 |
48 | exports
49 | DllGetClassObject,
50 | DllCanUnloadNow,
51 | DllRegisterServer,
52 | DllUnregisterServer;
53 |
54 | {$R *.res}
55 |
56 | begin
57 | end.
58 |
--------------------------------------------------------------------------------
/src/COM/thundax.COMLib_10.dproj.local:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2017/05/19 19:12:47.000.138,C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\COM\thundax.COMLib.dproj=C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\COM\thundax.COMLib_10.dproj
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/COM/thundax.COMLib_10.identcache:
--------------------------------------------------------------------------------
1 | lC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\COM\interface\thundax.COMLib.contract.pas bC:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\COM\thundax.COMLib.Instance.pas _C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\DUnit\COM\Testthundax.COMLib.pas \C:\Users\thund\Source\Repos\thundax-delphi-personal-repository\src\COM\thundax.COMLib_10.dpr
--------------------------------------------------------------------------------
/src/COM/thundax.COMLib_10.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/src/COM/thundax.COMLib_10.res
--------------------------------------------------------------------------------
/src/COM/thundax.COMLib_10.stat:
--------------------------------------------------------------------------------
1 | [Stats]
2 | EditorSecs=100
3 | DesignerSecs=1
4 | InspectorSecs=1
5 | CompileSecs=108448
6 | OtherSecs=21
7 | StartTime=19/05/2017 19:07:17
8 | RealKeys=0
9 | EffectiveKeys=0
10 | DebugSecs=1
11 |
--------------------------------------------------------------------------------
/src/COM/thundax.COMLib_10.tlb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/src/COM/thundax.COMLib_10.tlb
--------------------------------------------------------------------------------
/src/COM/tlb/COMLib.ridl:
--------------------------------------------------------------------------------
1 | // ************************************************************************ //
2 | // WARNING
3 | // -------
4 | // This file is generated by the Type Library importer or Type Libary Editor.
5 | // Barring syntax errors, the Editor will parse modifications made to the file.
6 | // However, when applying changes via the Editor this file will be regenerated
7 | // and comments or formatting changes will be lost.
8 | // ************************************************************************ //
9 | // File generated on 18/02/2013 22:10:24 (- $Rev: 12980 $, 15904192).
10 |
11 | [
12 | uuid(F1755A6C-284D-400E-BAE2-89CB5F0C6EFD),
13 | version(1.0),
14 | helpstring("COMLib Library")
15 |
16 | ]
17 | library COMLib
18 | {
19 |
20 | importlib("stdole2.tlb");
21 |
22 |
23 |
24 | };
25 |
--------------------------------------------------------------------------------
/src/COM/tlb/COMLib.tlb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/src/COM/tlb/COMLib.tlb
--------------------------------------------------------------------------------
/src/ClassHelper/thundax.classHelper.example.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit thundax.classHelper.example;
29 |
30 | //Class helpers are a way to extend a class without using inheritance
31 |
32 | interface
33 |
34 | type
35 | TSQL = class
36 | function getQuery(): string;
37 | end;
38 |
39 | TSQLHelper = class helper for TSQL
40 | function formatParameter(param : Integer) : string;
41 | end;
42 |
43 | implementation
44 |
45 | uses
46 | SysUtils;
47 |
48 | { TSQL }
49 |
50 | function TSQL.getQuery: string;
51 | begin
52 | result := 'SELECT * FROM Table'
53 | end;
54 |
55 | { TSQLHelper }
56 |
57 | function TSQLHelper.formatParameter(param: Integer): string;
58 | begin
59 | result := Format('%d', [param]);
60 | end;
61 |
62 | end.
63 |
--------------------------------------------------------------------------------
/src/ClassOperator/thundax.classOperator.example.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit thundax.classOperator.example;
29 |
30 | interface
31 |
32 | //Only valid for records
33 | //List of operators
34 | //Add Binary Add(a: type; b: type): resultType; +
35 | //Subtract Binary Subtract(a: type; b: type) : resultType; -
36 | //Multiply Binary Multiply(a: type; b: type) : resultType; *
37 | //Divide Binary Divide(a: type; b: type) : resultType; /
38 | //IntDivide Binary IntDivide(a: type; b: type): resultType; div
39 | //Modulus Binary Modulus(a: type; b: type): resultType; mod
40 | //LeftShift Binary LeftShift(a: type; b: type): resultType; shl
41 | //RightShift Binary RightShift(a: type; b: type): resultType; shr
42 | //LogicalAnd Binary LogicalAnd(a: type; b: type): resultType; and
43 | //LogicalOr Binary LogicalOr(a: type; b: type): resultType; or
44 | //LogicalXor Binary LogicalXor(a: type; b: type): resultType; xor
45 | //BitwiseAnd Binary BitwiseAnd(a: type; b: type): resultType; and
46 | //BitwiseOr Binary BitwiseOr(a: type; b: type): resultType; or
47 | //BitwiseXor Binary BitwiseXor(a: type; b: type): resultType; xor
48 |
49 | type
50 | TMyRecord = record
51 | value : integer;
52 | class operator Add(a, b: TMyRecord): TMyRecord; // Addition of two operands of type TMyRecord
53 | class operator Subtract(a, b: TMyRecord): TMyRecord; // Subtraction of type TMyRecord
54 | class operator Implicit(a: Integer): TMyRecord; // Implicit conversion of an Integer to type TMyRecord
55 | class operator Implicit(a: TMyRecord): Integer; // Implicit conversion of TMyRecordto Integer
56 | class operator Explicit(a: Double): TMyRecord; // Explicit conversion of a Double to TMyRecord
57 | class operator Equal(a, b: TMyRecord): Boolean; // Equality operand
58 | class operator NotEqual(a, b: TMyRecord): Boolean; // Inequality operand
59 | class operator Multiply(a, b: TMyRecord): TMyRecord;
60 | class operator IntDivide(a, b: TMyRecord): TMyRecord;
61 | end;
62 |
63 | implementation
64 |
65 | class operator TMyRecord.Add(a, b: TMyRecord): TMyRecord;
66 | begin
67 | result.value := a.value + b.value;
68 | end;
69 |
70 | class operator TMyRecord.IntDivide(a, b: TMyRecord): TMyRecord;
71 | begin
72 | result.value := a.value div b.value;
73 | end;
74 |
75 | class operator TMyRecord.Equal(a, b: TMyRecord): Boolean;
76 | begin
77 | Result := a.value = b.value;
78 | end;
79 |
80 | class operator TMyRecord.Explicit(a: Double): TMyRecord;
81 | begin
82 | result.value := Round(a);
83 | end;
84 |
85 | class operator TMyRecord.Implicit(a: Integer): TMyRecord;
86 | begin
87 | result.value := a;
88 | end;
89 |
90 | class operator TMyRecord.Implicit(a: TMyRecord): Integer;
91 | begin
92 | result := a.value;
93 | end;
94 |
95 | class operator TMyRecord.Multiply(a, b: TMyRecord): TMyRecord;
96 | begin
97 | result.value := a.value * b.value;
98 | end;
99 |
100 | class operator TMyRecord.NotEqual(a, b: TMyRecord): Boolean;
101 | begin
102 | Result := a.value <> b.value;
103 | end;
104 |
105 | class operator TMyRecord.Subtract(a, b: TMyRecord): TMyRecord;
106 | begin
107 | Result := a.value - b.value;
108 | end;
109 |
110 | end.
111 |
--------------------------------------------------------------------------------
/src/Custom Attributes/thundax.customAttributes.Framework.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit thundax.customAttributes.Framework;
29 |
30 | interface
31 |
32 | uses
33 | Rtti, TestFramework;
34 |
35 | type
36 | TAttributeProc = reference to procedure(CustomAttr: TCustomAttribute);
37 |
38 | TFrameworkTestCase = class(TTestCase)
39 | public
40 | procedure TestAttributesMethod(CustomProc: TAttributeProc);
41 | end;
42 |
43 | implementation
44 |
45 | { TFrameworkTestCase }
46 |
47 | procedure TFrameworkTestCase.TestAttributesMethod(CustomProc: TAttributeProc);
48 | var
49 | ContextRtti: TRttiContext;
50 | RttiType: TRttiType;
51 | RttiMethod: TRttiMethod;
52 | CustomAttr: TCustomAttribute;
53 | begin
54 | ContextRtti := TRttiContext.Create;
55 | try
56 | RttiType := ContextRtti.GetType(Self.ClassType);
57 | for RttiMethod in RttiType.GetMethods do
58 | for CustomAttr in RttiMethod.GetAttributes do
59 | CustomProc(CustomAttr);
60 | finally
61 | ContextRtti.Free;
62 | end;
63 | end;
64 |
65 | end.
66 |
--------------------------------------------------------------------------------
/src/Design Patterns/AbstractFactory/thundax.AbstractFactory.pas:
--------------------------------------------------------------------------------
1 | unit thundax.AbstractFactory;
2 |
3 | interface
4 |
5 | type
6 | IAbstractVehicle = interface
7 | procedure Run();
8 | function ToString() : string;
9 | end;
10 |
11 | TCar = class(TInterfacedObject, IAbstractVehicle)
12 | procedure Run();
13 | function ToString() : string; override;
14 | end;
15 |
16 | TTruck = class(TInterfacedObject, IAbstractVehicle)
17 | procedure Run();
18 | function ToString() : string; override;
19 | end;
20 |
21 | TBus = class(TInterfacedObject, IAbstractVehicle)
22 | procedure Run();
23 | function ToString() : string; override;
24 | end;
25 |
26 | TVan = class(TInterfacedObject, IAbstractVehicle)
27 | procedure Run();
28 | function ToString() : string; override;
29 | end;
30 |
31 | TAbstractFactory = class(TObject)
32 | constructor Create();
33 | destructor Destroy(); override;
34 | function CreateCar() : IAbstractVehicle; virtual; abstract;
35 | function CreateTruck() : IAbstractVehicle; virtual; abstract;
36 | function CreateBus() : IAbstractVehicle; virtual; abstract;
37 | function CreateVan() : IAbstractVehicle; virtual; abstract;
38 | end;
39 |
40 | TVehicleFactory = class(TAbstractFactory)
41 | constructor Create();
42 | destructor Destroy(); override;
43 | function CreateCar() : IAbstractVehicle; override;
44 | function CreateTruck() : IAbstractVehicle; override;
45 | function CreateBus() : IAbstractVehicle; override;
46 | function CreateVan() : IAbstractVehicle; override;
47 | end;
48 |
49 | implementation
50 |
51 | { TCar }
52 |
53 | procedure TCar.Run;
54 | begin
55 |
56 | end;
57 |
58 | function TCar.ToString: string;
59 | begin
60 | result := 'Car';
61 | end;
62 |
63 | { TTruck }
64 |
65 | procedure TTruck.Run;
66 | begin
67 |
68 | end;
69 |
70 | function TTruck.ToString: string;
71 | begin
72 | result := 'Truck';
73 | end;
74 |
75 | { TBus }
76 |
77 | procedure TBus.Run;
78 | begin
79 |
80 | end;
81 |
82 | function TBus.ToString: string;
83 | begin
84 | result := 'Bus';
85 | end;
86 |
87 | { TVan }
88 |
89 | procedure TVan.Run;
90 | begin
91 |
92 | end;
93 |
94 | function TVan.ToString: string;
95 | begin
96 | result := 'Van';
97 | end;
98 |
99 | { TAbstractFactory }
100 |
101 | constructor TAbstractFactory.Create;
102 | begin
103 |
104 | end;
105 |
106 | destructor TAbstractFactory.Destroy;
107 | begin
108 |
109 | inherited;
110 | end;
111 |
112 | { TVehicleFactory }
113 |
114 | constructor TVehicleFactory.Create;
115 | begin
116 |
117 | end;
118 |
119 | function TVehicleFactory.CreateBus: IAbstractVehicle;
120 | begin
121 | result := TBus.Create;
122 | end;
123 |
124 | function TVehicleFactory.CreateCar: IAbstractVehicle;
125 | begin
126 | result := TCar.Create;
127 | end;
128 |
129 | function TVehicleFactory.CreateTruck: IAbstractVehicle;
130 | begin
131 | result := TTruck.Create;
132 | end;
133 |
134 | function TVehicleFactory.CreateVan: IAbstractVehicle;
135 | begin
136 | result := TVan.Create;
137 | end;
138 |
139 | destructor TVehicleFactory.Destroy;
140 | begin
141 |
142 | inherited;
143 | end;
144 |
145 | end.
146 |
--------------------------------------------------------------------------------
/src/Design Patterns/Prototype/thundax.Prototype.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit thundax.Prototype;
29 |
30 | interface
31 |
32 | uses
33 | Generics.Collections, Contnrs;
34 |
35 | type
36 | IVehicle = interface
37 | function Clone() : IVehicle;
38 | function ToString() : string;
39 | end;
40 |
41 | TCar = class(TInterfacedObject, IVehicle)
42 | function Clone() : IVehicle;
43 | function ToString() : string; override;
44 | end;
45 |
46 | TTruck = class(TInterfacedObject, IVehicle)
47 | function Clone() : IVehicle;
48 | function ToString() : string; override;
49 | end;
50 |
51 | TBus = class(TInterfacedObject, IVehicle)
52 | function Clone() : IVehicle;
53 | function ToString() : string; override;
54 | end;
55 |
56 | TVan = class(TInterfacedObject, IVehicle)
57 | function Clone() : IVehicle;
58 | function ToString() : string; override;
59 | end;
60 |
61 | TPrototypeFactory = class(TObject)
62 | private
63 | FVehicleDictionary : TDictionary;
64 | public
65 | constructor Create();
66 | destructor Destroy(); override;
67 | function MakeObject(Vehicle : String) : IVehicle;
68 | end;
69 |
70 | implementation
71 |
72 | uses
73 | SysUtils;
74 |
75 | { TBus }
76 |
77 | function TBus.Clone: IVehicle;
78 | begin
79 | Result := TBus.Create;
80 | end;
81 |
82 | function TBus.ToString: string;
83 | begin
84 | Result := 'Bus';
85 | end;
86 |
87 | { TTruck }
88 |
89 | function TTruck.Clone: IVehicle;
90 | begin
91 | Result := TTruck.Create;
92 | end;
93 |
94 | function TTruck.ToString: string;
95 | begin
96 | Result := 'Truck';
97 | end;
98 |
99 | { TCar }
100 |
101 | function TCar.Clone: IVehicle;
102 | begin
103 | Result := TCar.Create;
104 | end;
105 |
106 | function TCar.ToString: string;
107 | begin
108 | Result := 'Car';
109 | end;
110 |
111 | { TPrototypeFactory }
112 |
113 | constructor TPrototypeFactory.Create;
114 | begin
115 | FVehicleDictionary := TDictionary.create;
116 | FVehicleDictionary.Add('Car', TCar.Create);
117 | FVehicleDictionary.Add('Truck', TTruck.Create);
118 | FVehicleDictionary.Add('Bus', TBus.Create);
119 | FVehicleDictionary.Add('Van', TVan.Create);
120 | end;
121 |
122 | destructor TPrototypeFactory.Destroy;
123 | begin
124 | FreeAndNil(FVehicleDictionary);
125 | inherited;
126 | end;
127 |
128 | function TPrototypeFactory.MakeObject(Vehicle: String): IVehicle;
129 | var
130 | outVehicle : IVehicle;
131 | begin
132 | FVehicleDictionary.TryGetValue(Vehicle, outVehicle);
133 | result := outVehicle.Clone;
134 | end;
135 |
136 | { TVan }
137 |
138 | function TVan.Clone: IVehicle;
139 | begin
140 | Result := TVan.Create;
141 | end;
142 |
143 | function TVan.ToString: string;
144 | begin
145 | Result := 'Van';
146 | end;
147 |
148 | end.
149 |
--------------------------------------------------------------------------------
/src/Fluent Interfaces/thundax.fluentInterface.testimplementation.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit thundax.fluentInterface.testimplementation;
29 |
30 | interface
31 |
32 | uses
33 | Generics.collections, Generics.Defaults;
34 |
35 | type
36 | TQueryImplementation = class(TObject)
37 | function GetIntegerListQueryValues() : TList;
38 | function GetStringListQueryValues() : TList;
39 | end;
40 |
41 |
42 | implementation
43 |
44 | uses
45 | thundax.fluentInterface.example, AnsiStrings, Windows;
46 |
47 | { TQueryImplementation }
48 |
49 | function TQueryImplementation.GetIntegerListQueryValues: TList;
50 | var
51 | IqueryList : IQueryList;
52 | item : integer;
53 | begin
54 | Result := TList.Create;
55 | IqueryList := TQueryList
56 | .New()
57 | .FillList(function ( list : TList ) : Boolean
58 | var k : integer;
59 | begin
60 | for k := 0 to 100 do
61 | list.Add(Random(100));
62 | result := true;
63 | end);
64 |
65 | //Display filtered values
66 | for item in IqueryList
67 | .Select(function ( list : TList ) : TList
68 | var
69 | k : integer;
70 | selectList : TList;
71 | begin
72 | selectList := TList.Create;
73 | for k := 0 to list.Count-1 do
74 | begin
75 | if Abs(list.items[k]) > 0 then
76 | selectList.Add(list.items[k]);
77 | end;
78 | list.Free;
79 | result := selectList;
80 | end)
81 | .Where(function ( i : integer) : Boolean
82 | begin
83 | result := (i > 50);
84 | end)
85 | .Where(function ( i : integer) : Boolean
86 | begin
87 | result := (i < 75);
88 | end)
89 | .OrderBy(TComparer.Construct(
90 | function (const L, R: integer): integer
91 | begin
92 | result := L - R; //Ascending
93 | end
94 | )).Distinct.List do
95 | result.add(item);
96 | end;
97 |
98 | function TQueryImplementation.GetStringListQueryValues: TList;
99 | const
100 | Chars = '1234567890ABCDEFGHJKLMNPQRSTUVWXYZ!';
101 | var
102 | S: string;
103 | IqueryList : IQueryList;
104 | item : String;
105 | begin
106 | result := TList.Create;
107 | //Fill up the list with random strings
108 | IqueryList := TQueryList
109 | .New
110 | .FillList(function ( list : TList ) : Boolean
111 | var
112 | k : integer;
113 | l : Integer;
114 | begin
115 | Randomize;
116 | for k := 0 to 100 do
117 | begin
118 | S := '';
119 | for l := 1 to 8 do
120 | S := S + Chars[(Random(Length(Chars)) + 1)];
121 | list.Add(S);
122 | end;
123 | result := true;
124 | end);
125 | //Query the list and retrieve all items which contains 'A'
126 | for item in IqueryList.Where(function ( i : string) : Boolean
127 | begin
128 | result := (Pos('A', i) > 0);
129 | end).Distinct.List do
130 | result.add(item);
131 | end;
132 |
133 | end.
134 |
--------------------------------------------------------------------------------
/src/Logging/thundax.logging.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit thundax.logging;
29 |
30 | interface
31 |
32 | type
33 | TLog = class(TObject)
34 | private
35 | FLogTextFile : TextFile;
36 | FlogFileName : string;
37 | FWithDate : Boolean;
38 | function isFileAssigned() : Boolean;
39 | public
40 | constructor Create(logFileName : string; withDate : Boolean = false);
41 | destructor Destroy(); override;
42 | class function Start(logFileName : string; withDate : Boolean = false): TLog;
43 | procedure Print(msg : string);
44 | procedure ConsoleOutput(msg : string);
45 | procedure OutputDebug(msg : string);
46 | end;
47 |
48 | implementation
49 |
50 | uses
51 | Windows, SysUtils;
52 |
53 | { TLog }
54 |
55 | procedure TLog.ConsoleOutput(msg: string);
56 | begin
57 | WriteLn(Output, msg);
58 | end;
59 |
60 | constructor TLog.Create(logFileName: string; withDate : Boolean = false);
61 | begin
62 | FlogFileName := logFileName;
63 | FWithDate := withDate;
64 | end;
65 |
66 | destructor TLog.Destroy;
67 | begin
68 | if isFileAssigned() then
69 | CloseFile(FLogTextFile);
70 | inherited;
71 | end;
72 |
73 | function TLog.isFileAssigned: Boolean;
74 | begin
75 | Result := True;
76 | try
77 | Append(FLogTextFile);
78 | except
79 | Result := False;
80 | end;
81 | end;
82 |
83 | procedure TLog.OutputDebug(msg: string);
84 | begin
85 | OutputDebugString(PChar(Msg));
86 | end;
87 |
88 | procedure TLog.Print(msg: string);
89 | var
90 | outputString : string;
91 | begin
92 | AssignFile(FLogTextFile, FlogFileName);
93 | try
94 | if FileExists(FlogFileName) then
95 | Append(FLogTextFile) // If existing file
96 | else
97 | Rewrite(FLogTextFile); // Create if new
98 | outputString := msg;
99 | if FWithDate then
100 | outputString := formatDateTime('dd/mm/yy hh:nn:ss ', Now) + msg;
101 | WriteLn(FLogTextFile, outputString);
102 | CloseFile(FLogTextFile);
103 | except
104 | end;
105 | end;
106 |
107 | class function TLog.Start(logFileName: string; withDate : Boolean = false): TLog;
108 | begin
109 | result := Create(logFileName, withDate);
110 | end;
111 |
112 | end.
113 |
--------------------------------------------------------------------------------
/src/Mock/thundax.mock.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit thundax.mock;
29 |
30 | interface
31 |
32 | type
33 |
34 | IMock = interface
35 | ['{50FA2453-6ABF-4132-925D-A9C0BF3E9071}']
36 | end;
37 |
38 | TMock = class(TInterfacedObject,IMock)
39 | private
40 | FMockClass : T;
41 | public
42 | function SetUp() : T;
43 | constructor Create(mockingClass : T);
44 | end;
45 |
46 | implementation
47 |
48 | uses
49 | Windows;
50 |
51 | { TMock }
52 |
53 | constructor TMock.Create(mockingClass: T);
54 | begin
55 | FMockClass := mockingClass;
56 | end;
57 |
58 | function TMock.SetUp(): T;
59 | begin
60 | Result := FMockClass;
61 | end;
62 |
63 | end.
64 |
--------------------------------------------------------------------------------
/src/Regular Expressions/thundax.stringHelper.contract.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit thundax.stringHelper.contract;
29 |
30 | interface
31 |
32 | uses
33 | RegularExpressions;
34 |
35 | type
36 | IStringHelper = interface
37 | function GetText : string;
38 | procedure SetText(const Value : string);
39 | property Text : string read GetText write SetText;
40 | function Left(numChars : Integer) : IStringHelper;
41 | function Right(numChars : Integer) : IStringHelper;
42 | function isMatch(regEx : string) : Boolean;
43 | function MatchGroups(regEx: string): TGroupCollection;
44 | function ToString() : string;
45 | end;
46 |
47 | implementation
48 |
49 | end.
50 |
--------------------------------------------------------------------------------
/src/Regular Expressions/thundax.stringHelper.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit thundax.stringHelper;
29 |
30 | interface
31 |
32 | uses
33 | thundax.stringHelper.contract, RegularExpressions;
34 |
35 | type
36 | TStringHelper = class(TInterfacedObject, IStringHelper)
37 | private
38 | FText : string;
39 | function GetText : string;
40 | procedure SetText(const Value : string);
41 | public
42 | property Text : string read GetText write SetText;
43 | constructor Create(text : string);
44 | class function New(text : string) : IStringHelper;
45 | function Left(numChars : Integer) : IStringHelper;
46 | function Right(numChars : Integer) : IStringHelper;
47 | function isMatch(regEx : string) : Boolean;
48 | function MatchGroups(regEx: string): TGroupCollection;
49 | function ToString() : string; override;
50 | end;
51 |
52 | implementation
53 |
54 | uses
55 | AnsiStrings, StrUtils;
56 |
57 | { TStringHelper }
58 |
59 | constructor TStringHelper.Create(text: string);
60 | begin
61 | FText := text;
62 | end;
63 |
64 | function TStringHelper.GetText: string;
65 | begin
66 | result := FText;
67 | end;
68 |
69 | function TStringHelper.isMatch(regEx: string): Boolean;
70 | var
71 | expression: TRegEx;
72 | begin
73 | expression := TRegEx.Create(regEx);
74 | result := expression.IsMatch(GetText);
75 | end;
76 |
77 | function TStringHelper.MatchGroups(regEx: string): TGroupCollection;
78 | var
79 | expression: TRegEx;
80 | begin
81 | expression := TRegEx.Create(regEx);
82 | result := expression.Match(GetText).Groups;
83 | end;
84 |
85 | function TStringHelper.Left(numChars: Integer): IStringHelper;
86 | begin
87 | SetText(AnsiLeftStr(GetText, numChars));
88 | result := Self;
89 | end;
90 |
91 | class function TStringHelper.New(text : string): IStringHelper;
92 | begin
93 | result := Create(text);
94 | end;
95 |
96 | function TStringHelper.Right(numChars: Integer): IStringHelper;
97 | begin
98 | SetText(AnsiRightStr(GetText, numChars));
99 | result := Self;
100 | end;
101 |
102 | procedure TStringHelper.SetText(const Value: string);
103 | begin
104 | FText := Value;
105 | end;
106 |
107 | function TStringHelper.ToString: string;
108 | begin
109 | result := FText;
110 | end;
111 |
112 | end.
113 |
--------------------------------------------------------------------------------
/src/UML/thundax.UML.pas:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012-2013, Jordi Corbilla
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are met:
6 | //
7 | // - Redistributions of source code must retain the above copyright notice,
8 | // this list of conditions and the following disclaimer.
9 | // - Redistributions in binary form must reproduce the above copyright notice,
10 | // this list of conditions and the following disclaimer in the documentation
11 | // and/or other materials provided with the distribution.
12 | // - Neither the name of this library nor the names of its contributors may be
13 | // used to endorse or promote products derived from this software without
14 | // specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | // POSSIBILITY OF SUCH DAMAGE.
27 |
28 | unit thundax.UML;
29 |
30 | interface
31 |
32 | uses
33 | thundax.logging;
34 |
35 | type
36 | TUML = class(TObject)
37 | private
38 | FFormat: string;
39 | FOutFile: TLog;
40 | FUmlFileName: string;
41 | public
42 | property Format: string read FFormat write FFormat;
43 | constructor Create(umlFileName: string);
44 | destructor Destroy(); override;
45 | class function Start(umlFileName: string): TUML;
46 | procedure Define(name : String; kind : String); overload;
47 | procedure Define(); overload;
48 | procedure Call(caller: string; callee: string; method: string; params: string); overload;
49 | procedure Call(caller: string; callee: string; method: string; params: string; result: string); overload;
50 | procedure Convert();
51 | end;
52 |
53 | const
54 | DefaultFormat = 'jpg';
55 | DefaultLocationLibrary = '..\..\thirdpartylibs\sdedit\sdedit.jar';
56 |
57 | implementation
58 |
59 | uses
60 | ShellAPI, Windows;
61 |
62 | { TUML }
63 |
64 | procedure TUML.Call(caller, callee, method, params: string);
65 | begin
66 | FOutFile.print(caller + ':' + callee + '.' + method + '(' + params + ')');
67 | end;
68 |
69 | procedure TUML.Call(caller, callee, method, params, result: string);
70 | begin
71 | FOutFile.print(caller + ':' + result + '=' + callee + '.' + method + '(' + params + ')');
72 | end;
73 |
74 | procedure TUML.Convert();
75 | var
76 | params: string;
77 | FileINFormat: string;
78 | FileOutFormat: string;
79 | begin
80 | FileINFormat := FUmlFileName + '.sdx';
81 | FileOutFormat := FUmlFileName + '.' + FFormat;
82 | params := '-jar ' + DefaultLocationLibrary + ' -o ' + FileOutFormat + ' -t ' + FFormat + ' -r landscape ' + FileINFormat;
83 | ShellExecute(0, nil, 'java.exe', PChar(params), nil, SW_HIDE);
84 | end;
85 |
86 | constructor TUML.Create(umlFileName: string);
87 | begin
88 | FOutFile := TLog.Start(umlFileName + '.sdx');
89 | FFormat := DefaultFormat;
90 | FUmlFileName := umlFileName;
91 | end;
92 |
93 | procedure TUML.Define;
94 | begin
95 | FOutFile.print('');
96 | end;
97 |
98 | destructor TUML.Destroy;
99 | begin
100 | FOutFile.Free;
101 | inherited;
102 | end;
103 |
104 | procedure TUML.Define(name, kind: String);
105 | begin
106 | FOutFile.print(name + ':' + kind);
107 | end;
108 |
109 | class function TUML.Start(umlFileName: string): TUML;
110 | begin
111 | result := Create(umlFileName);
112 | end;
113 |
114 | end.
115 |
--------------------------------------------------------------------------------
/thirdpartylibs/sdedit/license.txt:
--------------------------------------------------------------------------------
1 | Author
2 | Markus Strauch
3 |
4 | Copyright
5 | Copyright (c) 2006 - 2008, Markus Strauch. All rights reserved.
6 |
7 | License
8 | This program is released under the BSD license:
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | Redistributions of source code must retain the above copyright notice, this list of
14 | conditions and the following disclaimer.
15 |
16 | Redistributions in binary form must reproduce the above copyright notice, this list
17 | of conditions and the following disclaimer in the documentation and/or other materials
18 | provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
21 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
23 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
24 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/thirdpartylibs/sdedit/sdedit.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JordiCorbilla/thundax-delphi-personal-repository/f2ebd82add5c0e45d1287a322acb25a7151912e3/thirdpartylibs/sdedit/sdedit.jar
--------------------------------------------------------------------------------
/thundax.projectGroup.groupproj.local:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------