Skip to content

Commit f29d2c0

Browse files
Used unit namespaces, removed all efforts to support earlier than XE2 (pointless).
1 parent e9c32de commit f29d2c0

27 files changed

+1534
-243
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Delphi Mocks
22

3-
Delphi Mocks is a simple mocking framework for Delphi XE2 or later. It makes use of RTTI features that are only available in Delphi XE2, however I do hope to be able to get it working with earlier versions of Delphi (2010 or later) at some stage.
3+
Delphi Mocks is a simple mocking framework for Delphi XE2 or later. It makes use of RTTI features that are only available in Delphi XE2.
44

55
# Example
66

@@ -43,7 +43,7 @@ type
4343
implementation
4444
4545
uses
46-
Rtti;
46+
System.Rtti;
4747
4848
{ TMockObjectTests }
4949

Source/Delphi.Mocks.AutoMock.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
interface
44

55
uses
6-
TypInfo,
6+
System.TypInfo,
77
System.Generics.Collections,
88
Delphi.Mocks,
99
Delphi.Mocks.WeakReference;

Source/Delphi.Mocks.Behavior.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
interface
2929

3030
uses
31-
Rtti,
32-
SysUtils,
31+
System.Rtti,
32+
System.SysUtils,
3333
Delphi.Mocks,
3434
Delphi.Mocks.Interfaces,
3535
Delphi.Mocks.ParamMatcher;

Source/Delphi.Mocks.Expectation.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface
2929

3030

3131
uses
32-
Rtti,
32+
System.Rtti,
3333
Delphi.Mocks,
3434
Delphi.Mocks.ParamMatcher,
3535
Delphi.Mocks.Interfaces,
@@ -96,7 +96,7 @@ TExpectation = class(TInterfacedObject,IExpectation)
9696
implementation
9797

9898
uses
99-
SysUtils,
99+
System.SysUtils,
100100
Delphi.Mocks.Helpers;
101101

102102
{ TExpectation }

Source/Delphi.Mocks.Helpers.pas

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
interface
3434

3535
uses
36-
Rtti;
36+
System.Rtti;
3737

3838
type
3939
//TValue really needs to have an Equals operator overload!
@@ -85,11 +85,11 @@ function SameValue(const Left, Right: TValue): Boolean;
8585
implementation
8686

8787
uses
88-
SysUtils,
89-
Math,
90-
TypInfo,
91-
Variants,
92-
StrUtils;
88+
System.SysUtils,
89+
System.Math,
90+
System.TypInfo,
91+
System.Variants,
92+
System.StrUtils;
9393

9494
var
9595
Context : TRttiContext;
@@ -107,11 +107,11 @@ function CompareValue(const Left, Right: TValue): Integer;
107107
if leftIsEmpty or rightIsEmpty then
108108
Result := EmptyResults[leftIsEmpty, rightIsEmpty]
109109
else if left.IsOrdinal and right.IsOrdinal then
110-
Result := Math.CompareValue(left.AsOrdinal, right.AsOrdinal)
110+
Result := System.Math.CompareValue(left.AsOrdinal, right.AsOrdinal)
111111
else if left.IsFloat and right.IsFloat then
112-
Result := Math.CompareValue(left.AsExtended, right.AsExtended)
112+
Result := System.Math.CompareValue(left.AsExtended, right.AsExtended)
113113
else if left.IsString and right.IsString then
114-
Result := SysUtils.AnsiCompareStr(left.AsString, right.AsString)
114+
Result := System.SysUtils.AnsiCompareStr(left.AsString, right.AsString)
115115
else if left.IsObject and right.IsObject then
116116
Result := NativeInt(left.AsObject) - NativeInt(right.AsObject) // TODO: instance comparer
117117
else if Left.IsInterface and Right.IsInterface then

Source/Delphi.Mocks.Interfaces.pas

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
interface
2929

3030
uses
31-
SysUtils,
32-
TypInfo,
33-
Generics.Collections,
31+
System.SysUtils,
32+
System.TypInfo,
33+
System.Rtti,
34+
System.Generics.Collections,
3435
Delphi.Mocks,
35-
Delphi.Mocks.ParamMatcher,
36-
Rtti;
36+
Delphi.Mocks.ParamMatcher;
3737

3838
type
3939
TBehaviorType = (WillReturn,ReturnDefault,WillRaise,WillRaiseAlways,WillExecute,WillExecuteWhen);

Source/Delphi.Mocks.MethodData.pas

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
interface
3232

3333
uses
34-
Rtti,
35-
SysUtils,
36-
Generics.Collections,
34+
System.Rtti,
35+
System.SysUtils,
36+
System.Generics.Collections,
3737
Delphi.Mocks,
3838
Delphi.Mocks.Interfaces,
3939
Delphi.Mocks.ParamMatcher;

Source/Delphi.Mocks.ObjectProxy.pas

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,13 @@
2828
interface
2929

3030
uses
31-
Rtti,
32-
SysUtils,
33-
TypInfo,
34-
Generics.Collections,
31+
System.Rtti,
32+
System.SysUtils,
33+
System.TypInfo,
34+
System.Generics.Collections,
3535
Delphi.Mocks,
3636
Delphi.Mocks.Interfaces,
37-
Delphi.Mocks.Proxy,
38-
Delphi.Mocks.VirtualMethodInterceptor;
37+
Delphi.Mocks.Proxy;
3938

4039
type
4140
TObjectProxy<T> = class(TProxy<T>)

Source/Delphi.Mocks.ParamMatcher.pas

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
interface
2929

3030
uses
31-
Generics.Collections,
32-
SysUtils,
33-
TypInfo,
34-
Rtti;
31+
System.Generics.Collections,
32+
System.SysUtils,
33+
System.TypInfo,
34+
System.Rtti;
3535

3636

3737
type
@@ -67,8 +67,8 @@ TMatcherFactory = class
6767
implementation
6868

6969
uses
70-
Classes,
71-
SyncObjs;
70+
System.Classes,
71+
System.SyncObjs;
7272

7373

7474
{ TMatcherFactory }

Source/Delphi.Mocks.Proxy.TypeInfo.pas

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
interface
2929

3030
uses
31-
Rtti,
32-
SysUtils,
33-
Generics.Collections,
34-
TypInfo,
31+
System.Rtti,
32+
System.SysUtils,
33+
System.Generics.Collections,
34+
System.TypInfo,
3535
Delphi.Mocks,
3636
Delphi.Mocks.Proxy,
3737
Delphi.Mocks.WeakReference,

0 commit comments

Comments
 (0)