diff --git a/test/photo_gallery_test.dart b/test/photo_gallery_test.dart index 6f85aa8..2fd5027 100644 --- a/test/photo_gallery_test.dart +++ b/test/photo_gallery_test.dart @@ -68,10 +68,9 @@ void main() { }); test('get collection thumbnail', () async { - String collectionId = "__ALL__"; - List result = await PhotoGallery.getAlbumThumbnail(albumId: collectionId); - List expected = - Generator.generateMockCollectionThumbnail(collectionId: collectionId); + String albumId = "__ALL__"; + List result = await PhotoGallery.getAlbumThumbnail(albumId: albumId); + List expected = Generator.generateMockCollectionThumbnail(albumId: albumId); expect(result, expected); }); diff --git a/test/utils/generator.dart b/test/utils/generator.dart index ad30df3..7f2c261 100644 --- a/test/utils/generator.dart +++ b/test/utils/generator.dart @@ -13,7 +13,7 @@ class Generator { "count": 5, }, { - "id": "CollectionId", + "id": "AlbumId", "mediumType": mediumTypeToJson(mediumType), "name": "CollectionName", "count": 5, @@ -28,7 +28,7 @@ class Generator { } static dynamic generateMediaPageJson({ - String collectionId, + String albumId, MediumType mediumType, int total, int skip, @@ -72,7 +72,7 @@ class Generator { int take, }) { dynamic json = generateMediaPageJson( - collectionId: collection.id, + albumId: collection.id, mediumType: mediumType, total: collection.count, skip: skip, @@ -98,7 +98,7 @@ class Generator { } static List generateMockCollectionThumbnail({ - String collectionId, + String albumId, }) { return [1, 2, 3, 4, 5, 6, 7, 8, 9]; } diff --git a/test/utils/mock_handler.dart b/test/utils/mock_handler.dart index 9019245..fc5ddb2 100644 --- a/test/utils/mock_handler.dart +++ b/test/utils/mock_handler.dart @@ -11,13 +11,13 @@ Future mockMethodCallHandler(MethodCall call) async { Generator.generateCollectionsJson(mediumType: mediumType); return collections; } else if (call.method == "listMedia") { - String collectionId = call.arguments['collectionId']; + String albumId = call.arguments['albumId']; MediumType mediumType = jsonToMediumType(call.arguments['mediumType']); int total = call.arguments['total']; int skip = call.arguments['skip']; int take = call.arguments['take']; dynamic mediaPage = Generator.generateMediaPageJson( - collectionId: collectionId, + albumId: albumId, mediumType: mediumType, total: total, skip: skip, @@ -37,9 +37,9 @@ Future mockMethodCallHandler(MethodCall call) async { mediumId: mediumId, mediumType: mediumType); return thumbnail; } else if (call.method == "getAlbumThumbnail") { - String collectionId = call.arguments['collectionId']; + String albumId = call.arguments['albumId']; dynamic thumbnail = - Generator.generateMockCollectionThumbnail(collectionId: collectionId); + Generator.generateMockCollectionThumbnail(albumId: albumId); return thumbnail; } else if (call.method == "getFile") { String mediumId = call.arguments['mediumId'];