rename 'collectionId' to 'albumId' in tests
This commit is contained in:
parent
e79e0771cb
commit
95bd030e91
@ -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);
|
||||
});
|
||||
|
||||
|
@ -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<int> generateMockCollectionThumbnail({
|
||||
String collectionId,
|
||||
String albumId,
|
||||
}) {
|
||||
return [1, 2, 3, 4, 5, 6, 7, 8, 9];
|
||||
}
|
||||
|
@ -11,13 +11,13 @@ Future<dynamic> 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<dynamic> 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'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user