mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-16 00:05:53 +01:00
Testing adjustments to work with the new RESTClient
This commit is contained in:
parent
181cf5aba9
commit
972237a17a
@ -4,7 +4,7 @@
|
|||||||
<ProjectVersion>19.1</ProjectVersion>
|
<ProjectVersion>19.1</ProjectVersion>
|
||||||
<FrameworkType>VCL</FrameworkType>
|
<FrameworkType>VCL</FrameworkType>
|
||||||
<Base>True</Base>
|
<Base>True</Base>
|
||||||
<Config Condition="'$(Config)'==''">CI</Config>
|
<Config Condition="'$(Config)'==''">GUI</Config>
|
||||||
<Platform Condition="'$(Platform)'==''">Win32</Platform>
|
<Platform Condition="'$(Platform)'==''">Win32</Platform>
|
||||||
<TargetedPlatforms>1</TargetedPlatforms>
|
<TargetedPlatforms>1</TargetedPlatforms>
|
||||||
<AppType>Console</AppType>
|
<AppType>Console</AppType>
|
||||||
|
@ -933,7 +933,7 @@ end;
|
|||||||
|
|
||||||
procedure TServerTest.TestEntityWithArrays;
|
procedure TServerTest.TestEntityWithArrays;
|
||||||
var
|
var
|
||||||
lRes: IRESTResponse;
|
lRes: IMVCRESTResponse;
|
||||||
lObj1, lObj2: TEntityWithArray;
|
lObj1, lObj2: TEntityWithArray;
|
||||||
lBody: String;
|
lBody: String;
|
||||||
begin
|
begin
|
||||||
@ -944,10 +944,10 @@ begin
|
|||||||
lObj1.Booleans := [true, false];
|
lObj1.Booleans := [true, false];
|
||||||
lBody := GetDefaultSerializer.SerializeObject(lObj1);
|
lBody := GetDefaultSerializer.SerializeObject(lObj1);
|
||||||
|
|
||||||
lRes := RESTClient.doPOST('/entitywitharrays', [], lBody);
|
lRes := RESTClient.Post('/entitywitharrays', lBody);
|
||||||
lObj2 := TEntityWithArray.Create;
|
lObj2 := TEntityWithArray.Create;
|
||||||
try
|
try
|
||||||
GetDefaultSerializer.DeserializeObject(lRes.BodyAsString, lObj2);
|
GetDefaultSerializer.DeserializeObject(lRes.Content, lObj2);
|
||||||
|
|
||||||
Assert.AreEqual(4, Length(lObj2.Names));
|
Assert.AreEqual(4, Length(lObj2.Names));
|
||||||
Assert.AreEqual(lObj1.Names[0], lObj2.Names[0]);
|
Assert.AreEqual(lObj1.Names[0], lObj2.Names[0]);
|
||||||
@ -975,7 +975,7 @@ end;
|
|||||||
|
|
||||||
procedure TServerTest.TestEntityWithEmptyArrays;
|
procedure TServerTest.TestEntityWithEmptyArrays;
|
||||||
var
|
var
|
||||||
lRes: IRESTResponse;
|
lRes: IMVCRESTResponse;
|
||||||
lObj1, lObj2: TEntityWithArray;
|
lObj1, lObj2: TEntityWithArray;
|
||||||
lBody: String;
|
lBody: String;
|
||||||
begin
|
begin
|
||||||
@ -983,10 +983,10 @@ begin
|
|||||||
try
|
try
|
||||||
lBody := GetDefaultSerializer.SerializeObject(lObj1);
|
lBody := GetDefaultSerializer.SerializeObject(lObj1);
|
||||||
|
|
||||||
lRes := RESTClient.doPOST('/entitywitharrays', [], lBody);
|
lRes := RESTClient.Post('/entitywitharrays', lBody);
|
||||||
lObj2 := TEntityWithArray.Create;
|
lObj2 := TEntityWithArray.Create;
|
||||||
try
|
try
|
||||||
GetDefaultSerializer.DeserializeObject(lRes.BodyAsString, lObj2);
|
GetDefaultSerializer.DeserializeObject(lRes.Content, lObj2);
|
||||||
|
|
||||||
Assert.AreEqual(1, Length(lObj2.Names));
|
Assert.AreEqual(1, Length(lObj2.Names));
|
||||||
Assert.AreEqual('added', lObj2.Names[0]);
|
Assert.AreEqual('added', lObj2.Names[0]);
|
||||||
|
Loading…
Reference in New Issue
Block a user