More unit tests for functional actions

This commit is contained in:
Daniele Teti 2023-07-19 14:35:25 +02:00
parent 329aaa9190
commit 7bf4b82db7
3 changed files with 1627 additions and 1535 deletions

View File

@ -311,6 +311,8 @@ type
[Test]
procedure TestFuncActionGetDatasetMultiple;
[Test]
procedure TestFuncActionGetComplexObject;
// test issues
[Test]
@ -1457,6 +1459,30 @@ begin
Assert.areEqual('This is a TEXT file', lRes.Content, '/static/folder1.html');
end;
procedure TServerTest.TestFuncActionGetComplexObject;
var
c1: IMVCRESTClient;
lRes: IMVCRESTResponse;
begin
c1 := TMVCRESTClient.New.BaseURL(TEST_SERVER_ADDRESS, 9999);
lRes := c1.Get('/api/v1/actionresult/complex');
Assert.areEqual(200, lRes.StatusCode);
var lJSON := lRes.ToJSONObject;
try
Assert.AreEqual(3, lJSON.Count);
Assert.IsTrue(lJSON.Types['value'] = jdtInt);
Assert.IsTrue(lJSON.Types['person'] = jdtObject);
Assert.IsTrue(lJSON.Types['people'] = jdtArray);
Assert.AreEqual(6, lJSON.O['person'].Count);
Assert.AreEqual(3, lJSON.A['people'].Count);
Assert.AreEqual(6, lJSON.A['people'][0].ObjectValue.Count);
Assert.AreEqual(6, lJSON.A['people'][1].ObjectValue.Count);
Assert.AreEqual(6, lJSON.A['people'][2].ObjectValue.Count);
finally
lJSON.Free;
end;
end;
procedure TServerTest.TestFuncActionGetDatasetMultiple;
var
c1: IMVCRESTClient;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff