From 972237a17a7bdc5358520d595db9a59c86cda7a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Duarte?= Date: Sun, 29 Nov 2020 10:34:02 -0300 Subject: [PATCH] Testing adjustments to work with the new RESTClient --- unittests/general/Several/DMVCFrameworkTests.dproj | 2 +- unittests/general/Several/LiveServerTestU.pas | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/unittests/general/Several/DMVCFrameworkTests.dproj b/unittests/general/Several/DMVCFrameworkTests.dproj index 79bd2a22..e8883eca 100644 --- a/unittests/general/Several/DMVCFrameworkTests.dproj +++ b/unittests/general/Several/DMVCFrameworkTests.dproj @@ -4,7 +4,7 @@ 19.1 VCL True - CI + GUI Win32 1 Console diff --git a/unittests/general/Several/LiveServerTestU.pas b/unittests/general/Several/LiveServerTestU.pas index 5eacf24e..50555dfc 100644 --- a/unittests/general/Several/LiveServerTestU.pas +++ b/unittests/general/Several/LiveServerTestU.pas @@ -933,7 +933,7 @@ end; procedure TServerTest.TestEntityWithArrays; var - lRes: IRESTResponse; + lRes: IMVCRESTResponse; lObj1, lObj2: TEntityWithArray; lBody: String; begin @@ -944,10 +944,10 @@ begin lObj1.Booleans := [true, false]; lBody := GetDefaultSerializer.SerializeObject(lObj1); - lRes := RESTClient.doPOST('/entitywitharrays', [], lBody); + lRes := RESTClient.Post('/entitywitharrays', lBody); lObj2 := TEntityWithArray.Create; try - GetDefaultSerializer.DeserializeObject(lRes.BodyAsString, lObj2); + GetDefaultSerializer.DeserializeObject(lRes.Content, lObj2); Assert.AreEqual(4, Length(lObj2.Names)); Assert.AreEqual(lObj1.Names[0], lObj2.Names[0]); @@ -975,7 +975,7 @@ end; procedure TServerTest.TestEntityWithEmptyArrays; var - lRes: IRESTResponse; + lRes: IMVCRESTResponse; lObj1, lObj2: TEntityWithArray; lBody: String; begin @@ -983,10 +983,10 @@ begin try lBody := GetDefaultSerializer.SerializeObject(lObj1); - lRes := RESTClient.doPOST('/entitywitharrays', [], lBody); + lRes := RESTClient.Post('/entitywitharrays', lBody); lObj2 := TEntityWithArray.Create; try - GetDefaultSerializer.DeserializeObject(lRes.BodyAsString, lObj2); + GetDefaultSerializer.DeserializeObject(lRes.Content, lObj2); Assert.AreEqual(1, Length(lObj2.Names)); Assert.AreEqual('added', lObj2.Names[0]);