mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 07:45:54 +01:00
More unit tests for functional actions
This commit is contained in:
parent
329aaa9190
commit
7bf4b82db7
@ -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
Loading…
Reference in New Issue
Block a user