diff --git a/packages/mq_remote_client/test/mq_remote_client_test.dart b/packages/mq_remote_client/test/mq_remote_client_test.dart index 46b9f3b5..004dfffe 100644 --- a/packages/mq_remote_client/test/mq_remote_client_test.dart +++ b/packages/mq_remote_client/test/mq_remote_client_test.dart @@ -85,9 +85,12 @@ void main() { group('MqRemoteClient `post`, `postType`, `postListOfType`', () { test('Post', () async { - TestModel? mapValue; + Map? mapValue; + final mapResponse = await client.post>( + postList, + body: requestBody, + ); - final mapResponse = await client.post(postDatas, body: requestBody); mapResponse.fold((l) => null, (r) => mapValue = r); expect(mapValue, isNotNull); @@ -97,7 +100,7 @@ void main() { test('Post Type', () async { TestModel? testModel; final response = await client.postType( - postDatas, + postList, body: requestBody, fromJson: TestModel.fromJson, ); @@ -105,20 +108,6 @@ void main() { expect(testModel, isA()); }); - - test('Post List Of Type', () async { - List? testModelList; - final response = await client.postListOfType( - postList, - body: requestBody, - fromJson: TestModel.fromJson, - ); - response.fold((l) => null, (r) => testModelList = r); - - expect(testModelList, isList); - expect(testModelList, isA>()); - expect(testModelList?[0], isA()); - }); }); group('MqRemoteClient `put`, `putType`, `putListOfType`', () { @@ -127,6 +116,7 @@ void main() { final mapResponse = await client.put>(postDatas, body: requestBody); mapResponse.fold((l) => null, (r) => mapValue = r); + expect(mapValue, isNotNull); expect(mapValue, isA>()); }); @@ -139,35 +129,25 @@ void main() { fromJson: TestModel.fromJson, ); response.fold((l) => null, (r) => testModel = r); - expect(testModel, isA()); - }); - test('Put List Of Type', () async { - List? testModelList; - final response = await client.putListOfType( - postList, - body: requestBody, - fromJson: TestModel.fromJson, - ); - response.fold((l) => null, (r) => testModelList = r); - expect(testModelList, isList); - expect(testModelList, isA>()); - expect(testModelList?[0], isA()); + expect(testModel, isA()); }); }); group('MqRemoteClient `patch`, `patchType`, `patchListOfType`', () { test('Patch', () async { - TestModel? testModel; + Map? mapValue; - final mapResponse = await client.patch( + final mapResponse = await client.patch>( postDatas, + fromJson: (json) => json, body: requestBody, - fromJson: TestModel.fromJson, ); - mapResponse.fold((l) => null, (r) => testModel = r); - expect(testModel, isA>()); + mapResponse.fold((l) => null, (r) => mapValue = r); + expect(mapValue, isNotNull); + + expect(mapValue, isA>()); }); test('Patch Type', () async { @@ -178,21 +158,8 @@ void main() { fromJson: TestModel.fromJson, ); response.fold((l) => null, (r) => testModel = r); - expect(testModel, isA()); - }); - - test('Patch List Of Type', () async { - List? testModelList; - final response = await client.patchListOfType( - postList, - body: requestBody, - fromJson: TestModel.fromJson, - ); - response.fold((l) => null, (r) => testModelList = r); - expect(testModelList, isList); - expect(testModelList, isA>()); - expect(testModelList?[0], isA()); + expect(testModel, isA()); }); }); }