refactor(mobile): DB repository for asset, backup, sync service (#12953)
* refactor(mobile): DB repository for asset, backup, sync service * review feedback * fix bug found by Alex --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
committed by
GitHub
parent
a2d457b01d
commit
15c04d3056
@@ -29,6 +29,13 @@ void main() {
|
||||
albumMediaRepository = MockAlbumMediaRepository();
|
||||
albumApiRepository = MockAlbumApiRepository();
|
||||
|
||||
when(() => albumRepository.transaction<void>(any())).thenAnswer(
|
||||
(call) => (call.positionalArguments.first as Function).call(),
|
||||
);
|
||||
when(() => assetRepository.transaction<Null>(any())).thenAnswer(
|
||||
(call) => (call.positionalArguments.first as Function).call(),
|
||||
);
|
||||
|
||||
sut = AlbumService(
|
||||
userService,
|
||||
syncService,
|
||||
@@ -144,7 +151,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
when(
|
||||
() => albumRepository.getById(AlbumStub.oneAsset.id),
|
||||
() => albumRepository.get(AlbumStub.oneAsset.id),
|
||||
).thenAnswer((_) async => AlbumStub.oneAsset);
|
||||
when(
|
||||
() => albumRepository.addAssets(AlbumStub.oneAsset, [AssetStub.image2]),
|
||||
|
||||
Reference in New Issue
Block a user