From abb3a05120716b468c1f61174bb866acc569f8aa Mon Sep 17 00:00:00 2001 From: Mumulhl Date: Sat, 24 Jan 2026 11:58:58 +0800 Subject: [PATCH] Support export writing check history and translate history --- lib/core/app_globals.dart | 2 + lib/database/app/daos.dart | 48 +- lib/models/backup/backup.dart | 18 +- lib/services/backup.dart | 21 +- node_modules/.pnpm-workspace-state-v1.json | 25 - package.json | 3 - test/database/daos_test.dart | 150 +++ test/models/backup_data_test.dart | 21 + test/services/backup_test.dart | 61 +- test/services/backup_test.mocks.dart | 1417 ++++++++++++++++++++ 10 files changed, 1728 insertions(+), 38 deletions(-) delete mode 100644 node_modules/.pnpm-workspace-state-v1.json delete mode 100644 package.json create mode 100644 test/database/daos_test.dart diff --git a/lib/core/app_globals.dart b/lib/core/app_globals.dart index acbdfbb..dd710cf 100644 --- a/lib/core/app_globals.dart +++ b/lib/core/app_globals.dart @@ -25,5 +25,7 @@ final mddAudioListDao = MddAudioListDao(mainDatabase); final mddAudioResourceDao = MddAudioResourceDao(mainDatabase); final wordbookDao = WordbookDao(mainDatabase); final wordbookTagsDao = WordbookTagsDao(mainDatabase); +final writingCheckHistoryDao = WritingCheckHistoryDao(mainDatabase); +final translateHistoryDao = TranslateHistoryDao(mainDatabase); final talker = TalkerFlutter.init(); diff --git a/lib/database/app/daos.dart b/lib/database/app/daos.dart index e7e9478..ba431d9 100644 --- a/lib/database/app/daos.dart +++ b/lib/database/app/daos.dart @@ -169,9 +169,17 @@ class WordbookDao extends DatabaseAccessor WordbookDao(super.attachedDatabase); Future addAllWords(List data) async { - await batch((batch) { - batch.insertAll(wordbook, data); - }); + final existing = await getAllWords(); + final existingSet = existing.map((e) => "${e.word}_${e.tag}").toSet(); + + final toInsert = + data.where((e) => !existingSet.contains("${e.word}_${e.tag}")).toList(); + + if (toInsert.isNotEmpty) { + await batch((batch) { + batch.insertAll(wordbook, toInsert); + }); + } } Future countTotalWords() async { @@ -458,6 +466,26 @@ class WritingCheckHistoryDao extends DatabaseAccessor ); } + Future addAllHistory(List data) async { + final existing = await getAllHistory(); + final existingSet = existing + .map((e) => + "${e.inputText}_${e.outputText}_${e.createdAt.millisecondsSinceEpoch}") + .toSet(); + + final toInsert = data.where((e) { + final key = + "${e.inputText}_${e.outputText}_${e.createdAt.millisecondsSinceEpoch}"; + return !existingSet.contains(key); + }).toList(); + + if (toInsert.isNotEmpty) { + await batch((batch) { + batch.insertAll(writingCheckHistory, toInsert); + }); + } + } + Future> getAllHistory() { return (select(writingCheckHistory) ..orderBy( @@ -493,6 +521,20 @@ class TranslateHistoryDao extends DatabaseAccessor ); } + Future addAllHistory(List data) async { + final existing = await getAllHistory(); + final existingSet = existing.map((e) => e.inputText).toSet(); + + final toInsert = + data.where((e) => !existingSet.contains(e.inputText)).toList(); + + if (toInsert.isNotEmpty) { + await batch((batch) { + batch.insertAll(translateHistory, toInsert); + }); + } + } + Future> getAllHistory() { return (select(translateHistory) ..orderBy( diff --git a/lib/models/backup/backup.dart b/lib/models/backup/backup.dart index 69fa1f1..438b45a 100644 --- a/lib/models/backup/backup.dart +++ b/lib/models/backup/backup.dart @@ -7,12 +7,16 @@ class BackupData { final List wordbookWords; final List wordbookTags; final List history; + final List writingCheckHistory; + final List translateHistory; BackupData({ required this.version, required this.wordbookWords, required this.wordbookTags, this.history = const [], + this.writingCheckHistory = const [], + this.translateHistory = const [], }); factory BackupData.fromJson(Map json) { @@ -25,6 +29,16 @@ class BackupData { .map((e) => WordbookTag.fromJson(e as Map)) .toList(), history: (json["history"] as List?)?.cast() ?? [], + writingCheckHistory: (json["writingCheckHistory"] as List?) + ?.map((e) => + WritingCheckHistoryData.fromJson(e as Map)) + .toList() ?? + [], + translateHistory: (json["translateHistory"] as List?) + ?.map((e) => + TranslateHistoryData.fromJson(e as Map)) + .toList() ?? + [], ); } @@ -34,7 +48,9 @@ class BackupData { "wordbookWords": wordbookWords.map((e) => e.toJson()).toList(), "wordbookTags": wordbookTags.map((e) => e.toJson()).toList(), "history": history, + "writingCheckHistory": + writingCheckHistory.map((e) => e.toJson()).toList(), + "translateHistory": translateHistory.map((e) => e.toJson()).toList(), }); } } - diff --git a/lib/services/backup.dart b/lib/services/backup.dart index a41822f..c1868b1 100644 --- a/lib/services/backup.dart +++ b/lib/services/backup.dart @@ -77,6 +77,8 @@ class BackupService { final WordbookDao wordbookDao; final WordbookTagsDao wordbookTagsDao; final HistoryDao historyDao; + final WritingCheckHistoryDao writingCheckHistoryDao; + final TranslateHistoryDao translateHistoryDao; final BackupFileHandler fileHandler; final WordbookModel? _wordbookModel; @@ -84,6 +86,8 @@ class BackupService { required this.wordbookDao, required this.wordbookTagsDao, required this.historyDao, + required this.writingCheckHistoryDao, + required this.translateHistoryDao, required this.fileHandler, WordbookModel? wordbookModel, }) : _wordbookModel = wordbookModel; @@ -96,14 +100,21 @@ class BackupService { }) async { final words = await wordbookDao.getAllWords(), tags = await wordbookTagsDao.getAllTags(), - history = await historyDao.getAllHistory(); + history = await historyDao.getAllHistory(), + writingCheckHistory = await writingCheckHistoryDao.getAllHistory(), + translateHistory = await translateHistoryDao.getAllHistory(); - if (words.isNotEmpty || history.isNotEmpty) { + if (words.isNotEmpty || + history.isNotEmpty || + writingCheckHistory.isNotEmpty || + translateHistory.isNotEmpty) { final backupData = BackupData( version: Backup.version, wordbookWords: words, wordbookTags: tags, history: history.map((e) => e.word).toList(), + writingCheckHistory: writingCheckHistory, + translateHistory: translateHistory, ); final jsonContent = backupData.toJson(); @@ -149,6 +160,8 @@ class BackupService { for (final word in backupData.history.reversed) { await historyDao.addHistory(word); } + await writingCheckHistoryDao.addAllHistory(backupData.writingCheckHistory); + await translateHistoryDao.addAllHistory(backupData.translateHistory); } } @@ -160,6 +173,8 @@ class Backup { wordbookDao: wordbookDao, wordbookTagsDao: wordbookTagsDao, historyDao: historyDao, + writingCheckHistoryDao: writingCheckHistoryDao, + translateHistoryDao: translateHistoryDao, fileHandler: DefaultBackupFileHandler(), ); await service.export( @@ -175,6 +190,8 @@ class Backup { wordbookDao: wordbookDao, wordbookTagsDao: wordbookTagsDao, historyDao: historyDao, + writingCheckHistoryDao: writingCheckHistoryDao, + translateHistoryDao: translateHistoryDao, fileHandler: DefaultBackupFileHandler(), ); await service.import(); diff --git a/node_modules/.pnpm-workspace-state-v1.json b/node_modules/.pnpm-workspace-state-v1.json deleted file mode 100644 index 9ed9e67..0000000 --- a/node_modules/.pnpm-workspace-state-v1.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "lastValidatedTimestamp": 1755744900263, - "projects": {}, - "pnpmfiles": [], - "settings": { - "autoInstallPeers": true, - "dedupeDirectDeps": false, - "dedupeInjectedDeps": true, - "dedupePeerDependents": true, - "dev": true, - "excludeLinksFromLockfile": false, - "hoistPattern": [ - "*" - ], - "hoistWorkspacePackages": true, - "injectWorkspacePackages": false, - "linkWorkspacePackages": false, - "nodeLinker": "isolated", - "optional": true, - "preferWorkspacePackages": false, - "production": true, - "publicHoistPattern": [] - }, - "filteredInstall": false -} diff --git a/package.json b/package.json deleted file mode 100644 index 4cdcd17..0000000 --- a/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "packageManager": "pnpm@10.15.0+sha512.486ebc259d3e999a4e8691ce03b5cac4a71cbeca39372a9b762cb500cfdf0873e2cb16abe3d951b1ee2cf012503f027b98b6584e4df22524e0c7450d9ec7aa7b" -} diff --git a/test/database/daos_test.dart b/test/database/daos_test.dart new file mode 100644 index 0000000..8d7f69d --- /dev/null +++ b/test/database/daos_test.dart @@ -0,0 +1,150 @@ +import 'package:ciyue/database/app/app.dart'; +import 'package:ciyue/database/app/daos.dart'; +import 'package:drift/drift.dart'; +import 'package:drift/native.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + late AppDatabase database; + late WordbookDao wordbookDao; + late TranslateHistoryDao translateHistoryDao; + late WritingCheckHistoryDao writingCheckHistoryDao; + + setUp(() { + // Use an in-memory database for testing + database = AppDatabase(NativeDatabase.memory()); + wordbookDao = WordbookDao(database); + translateHistoryDao = TranslateHistoryDao(database); + writingCheckHistoryDao = WritingCheckHistoryDao(database); + }); + + tearDown(() async { + await database.close(); + }); + + group('WordbookDao', () { + test('addAllWords should avoid duplicates based on word and tag', () async { + // 1. Insert an initial record + await wordbookDao.addWord('apple', tag: 1); + + final now = DateTime.now(); + // 2. Prepare import data + final newWords = [ + // Duplicate: same word and tag (should be skipped) + WordbookData(word: 'apple', tag: 1, createdAt: now), + // New: same word but different tag (should be inserted) + WordbookData(word: 'apple', tag: 2, createdAt: now), + // New: different word (should be inserted) + WordbookData(word: 'banana', tag: 1, createdAt: now), + ]; + + // 3. Perform batch add + await wordbookDao.addAllWords(newWords); + + // 4. Verify results + final allWords = await wordbookDao.getAllWords(); + + // We expect 3 records total: + // 1. original 'apple' (tag 1) + // 2. 'apple' (tag 2) + // 3. 'banana' (tag 1) + expect(allWords.length, 3); + + // Verify duplicate was not added (count remains 1 for apple/tag:1) + expect(allWords.where((w) => w.word == 'apple' && w.tag == 1).length, 1); + + // Verify new records were added + expect(allWords.where((w) => w.word == 'apple' && w.tag == 2).length, 1); + expect(allWords.where((w) => w.word == 'banana').length, 1); + }); + }); + + group('TranslateHistoryDao', () { + test('addAllHistory should avoid duplicates based on inputText', () async { + // 1. Insert an initial record + await translateHistoryDao.addHistory('hello'); + + final now = DateTime.now(); + // 2. Prepare import data + final newHistory = [ + // Duplicate: same inputText (should be skipped) + TranslateHistoryData(id: 100, inputText: 'hello', createdAt: now), + // New: different inputText (should be inserted) + TranslateHistoryData(id: 101, inputText: 'world', createdAt: now), + ]; + + // 3. Perform batch add + await translateHistoryDao.addAllHistory(newHistory); + + // 4. Verify results + final allHistory = await translateHistoryDao.getAllHistory(); + + // Expect 2 records: 'hello' and 'world' + expect(allHistory.length, 2); + expect( + allHistory.map((e) => e.inputText), containsAll(['hello', 'world'])); + }); + }); + + group('WritingCheckHistoryDao', () { + test('addAllHistory should avoid duplicates based on content matches', + () async { + final now = DateTime.fromMillisecondsSinceEpoch(1000000); + + // 1. Insert an initial record directly to set specific fields + await database + .into(database.writingCheckHistory) + .insert(WritingCheckHistoryCompanion( + inputText: Value('input1'), + outputText: Value('output1'), + createdAt: Value(now), + )); + + // 2. Prepare import data + final newHistory = [ + // Duplicate: Exact match on input, output, and time (should be skipped) + WritingCheckHistoryData( + id: 100, + inputText: 'input1', + outputText: 'output1', + createdAt: now), + // New: Different output (should be inserted) + WritingCheckHistoryData( + id: 101, + inputText: 'input1', + outputText: 'output2', + createdAt: now), + // New: Different time (should be inserted) + WritingCheckHistoryData( + id: 102, + inputText: 'input1', + outputText: 'output1', + createdAt: now.add(const Duration(seconds: 1))), + ]; + + // 3. Perform batch add + await writingCheckHistoryDao.addAllHistory(newHistory); + + // 4. Verify results + final allHistory = await writingCheckHistoryDao.getAllHistory(); + + // Expect 3 records: + // 1. Original + // 2. Different output + // 3. Different time + // The exact duplicate should be skipped. + expect(allHistory.length, 3); + + // Verify the duplicate logic by counting entries with original content + final originalContentCount = allHistory + .where((e) => + e.inputText == 'input1' && + e.outputText == 'output1' && + e.createdAt.millisecondsSinceEpoch == now.millisecondsSinceEpoch) + .length; + + expect(originalContentCount, 1, + reason: "Should satisfy exact match deduplication"); + }); + }); +} diff --git a/test/models/backup_data_test.dart b/test/models/backup_data_test.dart index 8dbeca5..ae27656 100644 --- a/test/models/backup_data_test.dart +++ b/test/models/backup_data_test.dart @@ -20,12 +20,29 @@ void main() { const WordbookTag(id: 1, tag: 'tag1'), ]; final history = ['history1', 'history2']; + final writingCheckHistory = [ + WritingCheckHistoryData( + id: 1, + inputText: 'input', + outputText: 'output', + createdAt: now, + ) + ]; + final translateHistory = [ + TranslateHistoryData( + id: 1, + inputText: 'input', + createdAt: now, + ) + ]; final backupData = BackupData( version: 1, wordbookWords: words, wordbookTags: tags, history: history, + writingCheckHistory: writingCheckHistory, + translateHistory: translateHistory, ); final jsonString = backupData.toJson(); @@ -35,6 +52,8 @@ void main() { expect(decoded['wordbookWords'].length, 1); expect(decoded['wordbookTags'].length, 1); expect(decoded['history'].length, 2); + expect(decoded['writingCheckHistory'].length, 1); + expect(decoded['translateHistory'].length, 1); // Verify word data final wordJson = decoded['wordbookWords'][0]; @@ -54,6 +73,8 @@ void main() { expect(importedData.wordbookTags.first.tag, 'tag1'); expect(importedData.history, equals(history)); + expect(importedData.writingCheckHistory.first.inputText, 'input'); + expect(importedData.translateHistory.first.inputText, 'input'); }); }); } diff --git a/test/services/backup_test.dart b/test/services/backup_test.dart index bdfbb26..2be181e 100644 --- a/test/services/backup_test.dart +++ b/test/services/backup_test.dart @@ -9,12 +9,21 @@ import 'package:mockito/mockito.dart'; import 'backup_test.mocks.dart'; -@GenerateMocks( - [WordbookDao, WordbookTagsDao, HistoryDao, BackupFileHandler, WordbookModel]) +@GenerateMocks([ + WordbookDao, + WordbookTagsDao, + HistoryDao, + WritingCheckHistoryDao, + TranslateHistoryDao, + BackupFileHandler, + WordbookModel +]) void main() { late MockWordbookDao mockWordbookDao; late MockWordbookTagsDao mockWordbookTagsDao; late MockHistoryDao mockHistoryDao; + late MockWritingCheckHistoryDao mockWritingCheckHistoryDao; + late MockTranslateHistoryDao mockTranslateHistoryDao; late MockBackupFileHandler mockFileHandler; late MockWordbookModel mockWordbookModel; late BackupService backupService; @@ -23,6 +32,8 @@ void main() { mockWordbookDao = MockWordbookDao(); mockWordbookTagsDao = MockWordbookTagsDao(); mockHistoryDao = MockHistoryDao(); + mockWritingCheckHistoryDao = MockWritingCheckHistoryDao(); + mockTranslateHistoryDao = MockTranslateHistoryDao(); mockFileHandler = MockBackupFileHandler(); mockWordbookModel = MockWordbookModel(); @@ -30,6 +41,8 @@ void main() { wordbookDao: mockWordbookDao, wordbookTagsDao: mockWordbookTagsDao, historyDao: mockHistoryDao, + writingCheckHistoryDao: mockWritingCheckHistoryDao, + translateHistoryDao: mockTranslateHistoryDao, fileHandler: mockFileHandler, wordbookModel: mockWordbookModel, ); @@ -45,11 +58,29 @@ void main() { ]; final tags = [const WordbookTag(id: 1, tag: 'tag1')]; final history = [const HistoryData(id: 1, word: 'history1')]; + final writingCheckHistory = [ + WritingCheckHistoryData( + id: 1, + inputText: 'input', + outputText: 'output', + createdAt: DateTime.now(), + ) + ]; + final translateHistory = [ + TranslateHistoryData( + id: 1, + inputText: 'input', + createdAt: DateTime.now(), + ) + ]; test('should do nothing if no words or history to export', () async { when(mockWordbookDao.getAllWords()).thenAnswer((_) async => []); when(mockWordbookTagsDao.getAllTags()).thenAnswer((_) async => []); when(mockHistoryDao.getAllHistory()).thenAnswer((_) async => []); + when(mockWritingCheckHistoryDao.getAllHistory()) + .thenAnswer((_) async => []); + when(mockTranslateHistoryDao.getAllHistory()).thenAnswer((_) async => []); await backupService.export( autoExport: false, @@ -66,6 +97,10 @@ void main() { when(mockWordbookDao.getAllWords()).thenAnswer((_) async => words); when(mockWordbookTagsDao.getAllTags()).thenAnswer((_) async => tags); when(mockHistoryDao.getAllHistory()).thenAnswer((_) async => history); + when(mockWritingCheckHistoryDao.getAllHistory()) + .thenAnswer((_) async => writingCheckHistory); + when(mockTranslateHistoryDao.getAllHistory()) + .thenAnswer((_) async => translateHistory); when(mockFileHandler.isAndroid).thenReturn(true); when(mockFileHandler.writeManualExportAndroid(any)) .thenAnswer((_) async {}); @@ -82,6 +117,10 @@ void main() { when(mockWordbookDao.getAllWords()).thenAnswer((_) async => words); when(mockWordbookTagsDao.getAllTags()).thenAnswer((_) async => tags); when(mockHistoryDao.getAllHistory()).thenAnswer((_) async => history); + when(mockWritingCheckHistoryDao.getAllHistory()) + .thenAnswer((_) async => writingCheckHistory); + when(mockTranslateHistoryDao.getAllHistory()) + .thenAnswer((_) async => translateHistory); when(mockFileHandler.isAndroid).thenReturn(false); when(mockFileHandler.writeManualExportDesktop(any)) .thenAnswer((_) async {}); @@ -98,6 +137,10 @@ void main() { when(mockWordbookDao.getAllWords()).thenAnswer((_) async => words); when(mockWordbookTagsDao.getAllTags()).thenAnswer((_) async => tags); when(mockHistoryDao.getAllHistory()).thenAnswer((_) async => history); + when(mockWritingCheckHistoryDao.getAllHistory()) + .thenAnswer((_) async => writingCheckHistory); + when(mockTranslateHistoryDao.getAllHistory()) + .thenAnswer((_) async => translateHistory); when(mockFileHandler.isAndroid).thenReturn(true); when(mockFileHandler.writeAutoExportAndroid(any, any, any)) .thenAnswer((_) async {}); @@ -116,6 +159,10 @@ void main() { when(mockWordbookDao.getAllWords()).thenAnswer((_) async => words); when(mockWordbookTagsDao.getAllTags()).thenAnswer((_) async => tags); when(mockHistoryDao.getAllHistory()).thenAnswer((_) async => history); + when(mockWritingCheckHistoryDao.getAllHistory()) + .thenAnswer((_) async => writingCheckHistory); + when(mockTranslateHistoryDao.getAllHistory()) + .thenAnswer((_) async => translateHistory); when(mockFileHandler.isAndroid).thenReturn(false); when(mockFileHandler.writeAutoExportDesktop(any, any)) .thenAnswer((_) async {}); @@ -137,7 +184,9 @@ void main() { "version": 1, "wordbookWords": [], "wordbookTags": [], - "history": ["history1", "history2"] + "history": ["history1", "history2"], + "writingCheckHistory": [], + "translateHistory": [] }); when(mockFileHandler.readImportFile()) @@ -145,6 +194,9 @@ void main() { when(mockWordbookModel.addAllWords(any)).thenAnswer((_) async {}); when(mockWordbookTagsDao.addAllTags(any)).thenAnswer((_) async {}); when(mockHistoryDao.addHistory(any)).thenAnswer((_) async => 1); + when(mockWritingCheckHistoryDao.addAllHistory(any)) + .thenAnswer((_) async {}); + when(mockTranslateHistoryDao.addAllHistory(any)).thenAnswer((_) async {}); await backupService.import(); @@ -153,6 +205,8 @@ void main() { // History should be added in reverse order: history2 then history1 verify(mockHistoryDao.addHistory("history2")).called(1); verify(mockHistoryDao.addHistory("history1")).called(1); + verify(mockWritingCheckHistoryDao.addAllHistory(any)).called(1); + verify(mockTranslateHistoryDao.addAllHistory(any)).called(1); }); test('should do nothing if file selection canceled', () async { @@ -164,4 +218,3 @@ void main() { }); }); } - diff --git a/test/services/backup_test.mocks.dart b/test/services/backup_test.mocks.dart index 56503be..c819a54 100644 --- a/test/services/backup_test.mocks.dart +++ b/test/services/backup_test.mocks.dart @@ -257,6 +257,50 @@ class _FakeHistoryDaoManager_20 extends _i1.SmartFake ); } +class _Fake$WritingCheckHistoryTable_21 extends _i1.SmartFake + implements _i2.$WritingCheckHistoryTable { + _Fake$WritingCheckHistoryTable_21( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeWritingCheckHistoryDaoManager_22 extends _i1.SmartFake + implements _i5.WritingCheckHistoryDaoManager { + _FakeWritingCheckHistoryDaoManager_22( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _Fake$TranslateHistoryTable_23 extends _i1.SmartFake + implements _i2.$TranslateHistoryTable { + _Fake$TranslateHistoryTable_23( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeTranslateHistoryDaoManager_24 extends _i1.SmartFake + implements _i5.TranslateHistoryDaoManager { + _FakeTranslateHistoryDaoManager_24( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + /// A class which mocks [WordbookDao]. /// /// See the documentation for Mockito's code generation for more information. @@ -2408,6 +2452,1379 @@ class MockHistoryDao extends _i1.Mock implements _i5.HistoryDao { ) as _i6.Future); } +/// A class which mocks [WritingCheckHistoryDao]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockWritingCheckHistoryDao extends _i1.Mock + implements _i5.WritingCheckHistoryDao { + MockWritingCheckHistoryDao() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.AppDatabase get attachedDatabase => (super.noSuchMethod( + Invocation.getter(#attachedDatabase), + returnValue: _FakeAppDatabase_0( + this, + Invocation.getter(#attachedDatabase), + ), + ) as _i2.AppDatabase); + + @override + _i3.DatabaseConnection get connection => (super.noSuchMethod( + Invocation.getter(#connection), + returnValue: _FakeDatabaseConnection_1( + this, + Invocation.getter(#connection), + ), + ) as _i3.DatabaseConnection); + + @override + _i3.DriftDatabaseOptions get options => (super.noSuchMethod( + Invocation.getter(#options), + returnValue: _FakeDriftDatabaseOptions_2( + this, + Invocation.getter(#options), + ), + ) as _i3.DriftDatabaseOptions); + + @override + _i3.SqlTypes get typeMapping => (super.noSuchMethod( + Invocation.getter(#typeMapping), + returnValue: _i7.dummyValue<_i3.SqlTypes>( + this, + Invocation.getter(#typeMapping), + ), + ) as _i3.SqlTypes); + + @override + _i3.QueryExecutor get executor => (super.noSuchMethod( + Invocation.getter(#executor), + returnValue: _FakeQueryExecutor_3( + this, + Invocation.getter(#executor), + ), + ) as _i3.QueryExecutor); + + @override + _i4.StreamQueryStore get streamQueries => (super.noSuchMethod( + Invocation.getter(#streamQueries), + returnValue: _FakeStreamQueryStore_4( + this, + Invocation.getter(#streamQueries), + ), + ) as _i4.StreamQueryStore); + + @override + _i3.DatabaseConnectionUser get resolvedEngine => (super.noSuchMethod( + Invocation.getter(#resolvedEngine), + returnValue: _FakeDatabaseConnectionUser_5( + this, + Invocation.getter(#resolvedEngine), + ), + ) as _i3.DatabaseConnectionUser); + + @override + _i2.$WritingCheckHistoryTable get writingCheckHistory => (super.noSuchMethod( + Invocation.getter(#writingCheckHistory), + returnValue: _Fake$WritingCheckHistoryTable_21( + this, + Invocation.getter(#writingCheckHistory), + ), + ) as _i2.$WritingCheckHistoryTable); + + @override + _i5.WritingCheckHistoryDaoManager get managers => (super.noSuchMethod( + Invocation.getter(#managers), + returnValue: _FakeWritingCheckHistoryDaoManager_22( + this, + Invocation.getter(#managers), + ), + ) as _i5.WritingCheckHistoryDaoManager); + + @override + _i6.Future addHistory( + String? inputText, + String? outputText, + ) => + (super.noSuchMethod( + Invocation.method( + #addHistory, + [ + inputText, + outputText, + ], + ), + returnValue: _i6.Future.value(0), + ) as _i6.Future); + + @override + _i6.Future addAllHistory(List<_i2.WritingCheckHistoryData>? data) => + (super.noSuchMethod( + Invocation.method( + #addAllHistory, + [data], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future> getAllHistory() => + (super.noSuchMethod( + Invocation.method( + #getAllHistory, + [], + ), + returnValue: _i6.Future>.value( + <_i2.WritingCheckHistoryData>[]), + ) as _i6.Future>); + + @override + _i6.Future clearHistory() => (super.noSuchMethod( + Invocation.method( + #clearHistory, + [], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future deleteHistory(int? id) => (super.noSuchMethod( + Invocation.method( + #deleteHistory, + [id], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future deleteHistories(List? ids) => (super.noSuchMethod( + Invocation.method( + #deleteHistories, + [ids], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Stream createStream( + _i4.QueryStreamFetcher? stmt) => + (super.noSuchMethod( + Invocation.method( + #createStream, + [stmt], + ), + returnValue: _i6.Stream.empty(), + ) as _i6.Stream); + + @override + T alias( + _i3.ResultSetImplementation? table, + String? alias, + ) => + (super.noSuchMethod( + Invocation.method( + #alias, + [ + table, + alias, + ], + ), + returnValue: _i7.dummyValue( + this, + Invocation.method( + #alias, + [ + table, + alias, + ], + ), + ), + ) as T); + + @override + void markTablesUpdated(Iterable<_i3.TableInfo<_i3.Table, dynamic>>? tables) => + super.noSuchMethod( + Invocation.method( + #markTablesUpdated, + [tables], + ), + returnValueForMissingStub: null, + ); + + @override + void notifyUpdates(Set<_i3.TableUpdate>? updates) => super.noSuchMethod( + Invocation.method( + #notifyUpdates, + [updates], + ), + returnValueForMissingStub: null, + ); + + @override + _i6.Stream> tableUpdates( + [_i3.TableUpdateQuery? query = const _i3.TableUpdateQuery.any()]) => + (super.noSuchMethod( + Invocation.method( + #tableUpdates, + [query], + ), + returnValue: _i6.Stream>.empty(), + ) as _i6.Stream>); + + @override + _i6.Future doWhenOpened( + _i6.FutureOr Function(_i3.QueryExecutor)? fn) => + (super.noSuchMethod( + Invocation.method( + #doWhenOpened, + [fn], + ), + returnValue: _i7.ifNotNull( + _i7.dummyValueOrNull( + this, + Invocation.method( + #doWhenOpened, + [fn], + ), + ), + (T v) => _i6.Future.value(v), + ) ?? + _FakeFuture_8( + this, + Invocation.method( + #doWhenOpened, + [fn], + ), + ), + ) as _i6.Future); + + @override + _i3.InsertStatement into( + _i3.TableInfo? table) => + (super.noSuchMethod( + Invocation.method( + #into, + [table], + ), + returnValue: _FakeInsertStatement_9( + this, + Invocation.method( + #into, + [table], + ), + ), + ) as _i3.InsertStatement); + + @override + _i3.UpdateStatement update( + _i3.TableInfo? table) => + (super.noSuchMethod( + Invocation.method( + #update, + [table], + ), + returnValue: _FakeUpdateStatement_10( + this, + Invocation.method( + #update, + [table], + ), + ), + ) as _i3.UpdateStatement); + + @override + _i3.SimpleSelectStatement select( + _i3.ResultSetImplementation? table, { + bool? distinct = false, + }) => + (super.noSuchMethod( + Invocation.method( + #select, + [table], + {#distinct: distinct}, + ), + returnValue: _FakeSimpleSelectStatement_11( + this, + Invocation.method( + #select, + [table], + {#distinct: distinct}, + ), + ), + ) as _i3.SimpleSelectStatement); + + @override + _i3.JoinedSelectStatement selectOnly( + _i3.ResultSetImplementation? table, { + bool? distinct = false, + }) => + (super.noSuchMethod( + Invocation.method( + #selectOnly, + [table], + {#distinct: distinct}, + ), + returnValue: _FakeJoinedSelectStatement_12( + this, + Invocation.method( + #selectOnly, + [table], + {#distinct: distinct}, + ), + ), + ) as _i3.JoinedSelectStatement); + + @override + _i3.BaseSelectStatement<_i3.TypedResult> selectExpressions( + Iterable<_i3.Expression>? columns) => + (super.noSuchMethod( + Invocation.method( + #selectExpressions, + [columns], + ), + returnValue: _FakeBaseSelectStatement_13<_i3.TypedResult>( + this, + Invocation.method( + #selectExpressions, + [columns], + ), + ), + ) as _i3.BaseSelectStatement<_i3.TypedResult>); + + @override + _i3.DeleteStatement delete( + _i3.TableInfo? table) => + (super.noSuchMethod( + Invocation.method( + #delete, + [table], + ), + returnValue: _FakeDeleteStatement_14( + this, + Invocation.method( + #delete, + [table], + ), + ), + ) as _i3.DeleteStatement); + + @override + _i6.Future customUpdate( + String? query, { + List<_i3.Variable>? variables = const [], + Set<_i3.ResultSetImplementation>? updates, + _i3.UpdateKind? updateKind, + }) => + (super.noSuchMethod( + Invocation.method( + #customUpdate, + [query], + { + #variables: variables, + #updates: updates, + #updateKind: updateKind, + }, + ), + returnValue: _i6.Future.value(0), + ) as _i6.Future); + + @override + _i6.Future customInsert( + String? query, { + List<_i3.Variable>? variables = const [], + Set<_i3.ResultSetImplementation>? updates, + }) => + (super.noSuchMethod( + Invocation.method( + #customInsert, + [query], + { + #variables: variables, + #updates: updates, + }, + ), + returnValue: _i6.Future.value(0), + ) as _i6.Future); + + @override + _i6.Future> customWriteReturning( + String? query, { + List<_i3.Variable>? variables = const [], + Set<_i3.ResultSetImplementation>? updates, + _i3.UpdateKind? updateKind, + }) => + (super.noSuchMethod( + Invocation.method( + #customWriteReturning, + [query], + { + #variables: variables, + #updates: updates, + #updateKind: updateKind, + }, + ), + returnValue: _i6.Future>.value(<_i3.QueryRow>[]), + ) as _i6.Future>); + + @override + _i3.Selectable<_i3.QueryRow> customSelect( + String? query, { + List<_i3.Variable>? variables = const [], + Set<_i3.ResultSetImplementation>? readsFrom = const {}, + }) => + (super.noSuchMethod( + Invocation.method( + #customSelect, + [query], + { + #variables: variables, + #readsFrom: readsFrom, + }, + ), + returnValue: _FakeSelectable_15<_i3.QueryRow>( + this, + Invocation.method( + #customSelect, + [query], + { + #variables: variables, + #readsFrom: readsFrom, + }, + ), + ), + ) as _i3.Selectable<_i3.QueryRow>); + + @override + _i3.Selectable<_i3.QueryRow> customSelectQuery( + String? query, { + List<_i3.Variable>? variables = const [], + Set<_i3.ResultSetImplementation>? readsFrom = const {}, + }) => + (super.noSuchMethod( + Invocation.method( + #customSelectQuery, + [query], + { + #variables: variables, + #readsFrom: readsFrom, + }, + ), + returnValue: _FakeSelectable_15<_i3.QueryRow>( + this, + Invocation.method( + #customSelectQuery, + [query], + { + #variables: variables, + #readsFrom: readsFrom, + }, + ), + ), + ) as _i3.Selectable<_i3.QueryRow>); + + @override + _i6.Future customStatement( + String? statement, [ + List? args, + ]) => + (super.noSuchMethod( + Invocation.method( + #customStatement, + [ + statement, + args, + ], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future transaction( + _i6.Future Function()? action, { + bool? requireNew = false, + }) => + (super.noSuchMethod( + Invocation.method( + #transaction, + [action], + {#requireNew: requireNew}, + ), + returnValue: _i7.ifNotNull( + _i7.dummyValueOrNull( + this, + Invocation.method( + #transaction, + [action], + {#requireNew: requireNew}, + ), + ), + (T v) => _i6.Future.value(v), + ) ?? + _FakeFuture_8( + this, + Invocation.method( + #transaction, + [action], + {#requireNew: requireNew}, + ), + ), + ) as _i6.Future); + + @override + _i6.Future exclusively(_i6.Future Function()? action) => + (super.noSuchMethod( + Invocation.method( + #exclusively, + [action], + ), + returnValue: _i7.ifNotNull( + _i7.dummyValueOrNull( + this, + Invocation.method( + #exclusively, + [action], + ), + ), + (T v) => _i6.Future.value(v), + ) ?? + _FakeFuture_8( + this, + Invocation.method( + #exclusively, + [action], + ), + ), + ) as _i6.Future); + + @override + _i6.Future batch(_i6.FutureOr Function(_i3.Batch)? runInBatch) => + (super.noSuchMethod( + Invocation.method( + #batch, + [runInBatch], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future runWithInterceptor( + _i6.Future Function()? action, { + required _i3.QueryInterceptor? interceptor, + }) => + (super.noSuchMethod( + Invocation.method( + #runWithInterceptor, + [action], + {#interceptor: interceptor}, + ), + returnValue: _i7.ifNotNull( + _i7.dummyValueOrNull( + this, + Invocation.method( + #runWithInterceptor, + [action], + {#interceptor: interceptor}, + ), + ), + (T v) => _i6.Future.value(v), + ) ?? + _FakeFuture_8( + this, + Invocation.method( + #runWithInterceptor, + [action], + {#interceptor: interceptor}, + ), + ), + ) as _i6.Future); + + @override + _i3.GenerationContext $write( + _i3.Component? component, { + bool? hasMultipleTables, + int? startIndex, + }) => + (super.noSuchMethod( + Invocation.method( + #$write, + [component], + { + #hasMultipleTables: hasMultipleTables, + #startIndex: startIndex, + }, + ), + returnValue: _FakeGenerationContext_16( + this, + Invocation.method( + #$write, + [component], + { + #hasMultipleTables: hasMultipleTables, + #startIndex: startIndex, + }, + ), + ), + ) as _i3.GenerationContext); + + @override + _i3.GenerationContext $writeInsertable( + _i3.TableInfo<_i3.Table, dynamic>? table, + _i3.Insertable? insertable, { + int? startIndex, + }) => + (super.noSuchMethod( + Invocation.method( + #$writeInsertable, + [ + table, + insertable, + ], + {#startIndex: startIndex}, + ), + returnValue: _FakeGenerationContext_16( + this, + Invocation.method( + #$writeInsertable, + [ + table, + insertable, + ], + {#startIndex: startIndex}, + ), + ), + ) as _i3.GenerationContext); + + @override + String $expandVar( + int? start, + int? amount, + ) => + (super.noSuchMethod( + Invocation.method( + #$expandVar, + [ + start, + amount, + ], + ), + returnValue: _i7.dummyValue( + this, + Invocation.method( + #$expandVar, + [ + start, + amount, + ], + ), + ), + ) as String); + + @override + _i6.Future close() => (super.noSuchMethod( + Invocation.method( + #close, + [], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); +} + +/// A class which mocks [TranslateHistoryDao]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockTranslateHistoryDao extends _i1.Mock + implements _i5.TranslateHistoryDao { + MockTranslateHistoryDao() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.AppDatabase get attachedDatabase => (super.noSuchMethod( + Invocation.getter(#attachedDatabase), + returnValue: _FakeAppDatabase_0( + this, + Invocation.getter(#attachedDatabase), + ), + ) as _i2.AppDatabase); + + @override + _i3.DatabaseConnection get connection => (super.noSuchMethod( + Invocation.getter(#connection), + returnValue: _FakeDatabaseConnection_1( + this, + Invocation.getter(#connection), + ), + ) as _i3.DatabaseConnection); + + @override + _i3.DriftDatabaseOptions get options => (super.noSuchMethod( + Invocation.getter(#options), + returnValue: _FakeDriftDatabaseOptions_2( + this, + Invocation.getter(#options), + ), + ) as _i3.DriftDatabaseOptions); + + @override + _i3.SqlTypes get typeMapping => (super.noSuchMethod( + Invocation.getter(#typeMapping), + returnValue: _i7.dummyValue<_i3.SqlTypes>( + this, + Invocation.getter(#typeMapping), + ), + ) as _i3.SqlTypes); + + @override + _i3.QueryExecutor get executor => (super.noSuchMethod( + Invocation.getter(#executor), + returnValue: _FakeQueryExecutor_3( + this, + Invocation.getter(#executor), + ), + ) as _i3.QueryExecutor); + + @override + _i4.StreamQueryStore get streamQueries => (super.noSuchMethod( + Invocation.getter(#streamQueries), + returnValue: _FakeStreamQueryStore_4( + this, + Invocation.getter(#streamQueries), + ), + ) as _i4.StreamQueryStore); + + @override + _i3.DatabaseConnectionUser get resolvedEngine => (super.noSuchMethod( + Invocation.getter(#resolvedEngine), + returnValue: _FakeDatabaseConnectionUser_5( + this, + Invocation.getter(#resolvedEngine), + ), + ) as _i3.DatabaseConnectionUser); + + @override + _i2.$TranslateHistoryTable get translateHistory => (super.noSuchMethod( + Invocation.getter(#translateHistory), + returnValue: _Fake$TranslateHistoryTable_23( + this, + Invocation.getter(#translateHistory), + ), + ) as _i2.$TranslateHistoryTable); + + @override + _i5.TranslateHistoryDaoManager get managers => (super.noSuchMethod( + Invocation.getter(#managers), + returnValue: _FakeTranslateHistoryDaoManager_24( + this, + Invocation.getter(#managers), + ), + ) as _i5.TranslateHistoryDaoManager); + + @override + _i6.Future addHistory(String? inputText) => (super.noSuchMethod( + Invocation.method( + #addHistory, + [inputText], + ), + returnValue: _i6.Future.value(0), + ) as _i6.Future); + + @override + _i6.Future addAllHistory(List<_i2.TranslateHistoryData>? data) => + (super.noSuchMethod( + Invocation.method( + #addAllHistory, + [data], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future> getAllHistory() => + (super.noSuchMethod( + Invocation.method( + #getAllHistory, + [], + ), + returnValue: _i6.Future>.value( + <_i2.TranslateHistoryData>[]), + ) as _i6.Future>); + + @override + _i6.Future clearHistory() => (super.noSuchMethod( + Invocation.method( + #clearHistory, + [], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future deleteHistory(int? id) => (super.noSuchMethod( + Invocation.method( + #deleteHistory, + [id], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future deleteHistories(List? ids) => (super.noSuchMethod( + Invocation.method( + #deleteHistories, + [ids], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future deleteHistoryByInputText(String? inputText) => + (super.noSuchMethod( + Invocation.method( + #deleteHistoryByInputText, + [inputText], + ), + returnValue: _i6.Future.value(0), + ) as _i6.Future); + + @override + _i6.Stream createStream( + _i4.QueryStreamFetcher? stmt) => + (super.noSuchMethod( + Invocation.method( + #createStream, + [stmt], + ), + returnValue: _i6.Stream.empty(), + ) as _i6.Stream); + + @override + T alias( + _i3.ResultSetImplementation? table, + String? alias, + ) => + (super.noSuchMethod( + Invocation.method( + #alias, + [ + table, + alias, + ], + ), + returnValue: _i7.dummyValue( + this, + Invocation.method( + #alias, + [ + table, + alias, + ], + ), + ), + ) as T); + + @override + void markTablesUpdated(Iterable<_i3.TableInfo<_i3.Table, dynamic>>? tables) => + super.noSuchMethod( + Invocation.method( + #markTablesUpdated, + [tables], + ), + returnValueForMissingStub: null, + ); + + @override + void notifyUpdates(Set<_i3.TableUpdate>? updates) => super.noSuchMethod( + Invocation.method( + #notifyUpdates, + [updates], + ), + returnValueForMissingStub: null, + ); + + @override + _i6.Stream> tableUpdates( + [_i3.TableUpdateQuery? query = const _i3.TableUpdateQuery.any()]) => + (super.noSuchMethod( + Invocation.method( + #tableUpdates, + [query], + ), + returnValue: _i6.Stream>.empty(), + ) as _i6.Stream>); + + @override + _i6.Future doWhenOpened( + _i6.FutureOr Function(_i3.QueryExecutor)? fn) => + (super.noSuchMethod( + Invocation.method( + #doWhenOpened, + [fn], + ), + returnValue: _i7.ifNotNull( + _i7.dummyValueOrNull( + this, + Invocation.method( + #doWhenOpened, + [fn], + ), + ), + (T v) => _i6.Future.value(v), + ) ?? + _FakeFuture_8( + this, + Invocation.method( + #doWhenOpened, + [fn], + ), + ), + ) as _i6.Future); + + @override + _i3.InsertStatement into( + _i3.TableInfo? table) => + (super.noSuchMethod( + Invocation.method( + #into, + [table], + ), + returnValue: _FakeInsertStatement_9( + this, + Invocation.method( + #into, + [table], + ), + ), + ) as _i3.InsertStatement); + + @override + _i3.UpdateStatement update( + _i3.TableInfo? table) => + (super.noSuchMethod( + Invocation.method( + #update, + [table], + ), + returnValue: _FakeUpdateStatement_10( + this, + Invocation.method( + #update, + [table], + ), + ), + ) as _i3.UpdateStatement); + + @override + _i3.SimpleSelectStatement select( + _i3.ResultSetImplementation? table, { + bool? distinct = false, + }) => + (super.noSuchMethod( + Invocation.method( + #select, + [table], + {#distinct: distinct}, + ), + returnValue: _FakeSimpleSelectStatement_11( + this, + Invocation.method( + #select, + [table], + {#distinct: distinct}, + ), + ), + ) as _i3.SimpleSelectStatement); + + @override + _i3.JoinedSelectStatement selectOnly( + _i3.ResultSetImplementation? table, { + bool? distinct = false, + }) => + (super.noSuchMethod( + Invocation.method( + #selectOnly, + [table], + {#distinct: distinct}, + ), + returnValue: _FakeJoinedSelectStatement_12( + this, + Invocation.method( + #selectOnly, + [table], + {#distinct: distinct}, + ), + ), + ) as _i3.JoinedSelectStatement); + + @override + _i3.BaseSelectStatement<_i3.TypedResult> selectExpressions( + Iterable<_i3.Expression>? columns) => + (super.noSuchMethod( + Invocation.method( + #selectExpressions, + [columns], + ), + returnValue: _FakeBaseSelectStatement_13<_i3.TypedResult>( + this, + Invocation.method( + #selectExpressions, + [columns], + ), + ), + ) as _i3.BaseSelectStatement<_i3.TypedResult>); + + @override + _i3.DeleteStatement delete( + _i3.TableInfo? table) => + (super.noSuchMethod( + Invocation.method( + #delete, + [table], + ), + returnValue: _FakeDeleteStatement_14( + this, + Invocation.method( + #delete, + [table], + ), + ), + ) as _i3.DeleteStatement); + + @override + _i6.Future customUpdate( + String? query, { + List<_i3.Variable>? variables = const [], + Set<_i3.ResultSetImplementation>? updates, + _i3.UpdateKind? updateKind, + }) => + (super.noSuchMethod( + Invocation.method( + #customUpdate, + [query], + { + #variables: variables, + #updates: updates, + #updateKind: updateKind, + }, + ), + returnValue: _i6.Future.value(0), + ) as _i6.Future); + + @override + _i6.Future customInsert( + String? query, { + List<_i3.Variable>? variables = const [], + Set<_i3.ResultSetImplementation>? updates, + }) => + (super.noSuchMethod( + Invocation.method( + #customInsert, + [query], + { + #variables: variables, + #updates: updates, + }, + ), + returnValue: _i6.Future.value(0), + ) as _i6.Future); + + @override + _i6.Future> customWriteReturning( + String? query, { + List<_i3.Variable>? variables = const [], + Set<_i3.ResultSetImplementation>? updates, + _i3.UpdateKind? updateKind, + }) => + (super.noSuchMethod( + Invocation.method( + #customWriteReturning, + [query], + { + #variables: variables, + #updates: updates, + #updateKind: updateKind, + }, + ), + returnValue: _i6.Future>.value(<_i3.QueryRow>[]), + ) as _i6.Future>); + + @override + _i3.Selectable<_i3.QueryRow> customSelect( + String? query, { + List<_i3.Variable>? variables = const [], + Set<_i3.ResultSetImplementation>? readsFrom = const {}, + }) => + (super.noSuchMethod( + Invocation.method( + #customSelect, + [query], + { + #variables: variables, + #readsFrom: readsFrom, + }, + ), + returnValue: _FakeSelectable_15<_i3.QueryRow>( + this, + Invocation.method( + #customSelect, + [query], + { + #variables: variables, + #readsFrom: readsFrom, + }, + ), + ), + ) as _i3.Selectable<_i3.QueryRow>); + + @override + _i3.Selectable<_i3.QueryRow> customSelectQuery( + String? query, { + List<_i3.Variable>? variables = const [], + Set<_i3.ResultSetImplementation>? readsFrom = const {}, + }) => + (super.noSuchMethod( + Invocation.method( + #customSelectQuery, + [query], + { + #variables: variables, + #readsFrom: readsFrom, + }, + ), + returnValue: _FakeSelectable_15<_i3.QueryRow>( + this, + Invocation.method( + #customSelectQuery, + [query], + { + #variables: variables, + #readsFrom: readsFrom, + }, + ), + ), + ) as _i3.Selectable<_i3.QueryRow>); + + @override + _i6.Future customStatement( + String? statement, [ + List? args, + ]) => + (super.noSuchMethod( + Invocation.method( + #customStatement, + [ + statement, + args, + ], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future transaction( + _i6.Future Function()? action, { + bool? requireNew = false, + }) => + (super.noSuchMethod( + Invocation.method( + #transaction, + [action], + {#requireNew: requireNew}, + ), + returnValue: _i7.ifNotNull( + _i7.dummyValueOrNull( + this, + Invocation.method( + #transaction, + [action], + {#requireNew: requireNew}, + ), + ), + (T v) => _i6.Future.value(v), + ) ?? + _FakeFuture_8( + this, + Invocation.method( + #transaction, + [action], + {#requireNew: requireNew}, + ), + ), + ) as _i6.Future); + + @override + _i6.Future exclusively(_i6.Future Function()? action) => + (super.noSuchMethod( + Invocation.method( + #exclusively, + [action], + ), + returnValue: _i7.ifNotNull( + _i7.dummyValueOrNull( + this, + Invocation.method( + #exclusively, + [action], + ), + ), + (T v) => _i6.Future.value(v), + ) ?? + _FakeFuture_8( + this, + Invocation.method( + #exclusively, + [action], + ), + ), + ) as _i6.Future); + + @override + _i6.Future batch(_i6.FutureOr Function(_i3.Batch)? runInBatch) => + (super.noSuchMethod( + Invocation.method( + #batch, + [runInBatch], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future runWithInterceptor( + _i6.Future Function()? action, { + required _i3.QueryInterceptor? interceptor, + }) => + (super.noSuchMethod( + Invocation.method( + #runWithInterceptor, + [action], + {#interceptor: interceptor}, + ), + returnValue: _i7.ifNotNull( + _i7.dummyValueOrNull( + this, + Invocation.method( + #runWithInterceptor, + [action], + {#interceptor: interceptor}, + ), + ), + (T v) => _i6.Future.value(v), + ) ?? + _FakeFuture_8( + this, + Invocation.method( + #runWithInterceptor, + [action], + {#interceptor: interceptor}, + ), + ), + ) as _i6.Future); + + @override + _i3.GenerationContext $write( + _i3.Component? component, { + bool? hasMultipleTables, + int? startIndex, + }) => + (super.noSuchMethod( + Invocation.method( + #$write, + [component], + { + #hasMultipleTables: hasMultipleTables, + #startIndex: startIndex, + }, + ), + returnValue: _FakeGenerationContext_16( + this, + Invocation.method( + #$write, + [component], + { + #hasMultipleTables: hasMultipleTables, + #startIndex: startIndex, + }, + ), + ), + ) as _i3.GenerationContext); + + @override + _i3.GenerationContext $writeInsertable( + _i3.TableInfo<_i3.Table, dynamic>? table, + _i3.Insertable? insertable, { + int? startIndex, + }) => + (super.noSuchMethod( + Invocation.method( + #$writeInsertable, + [ + table, + insertable, + ], + {#startIndex: startIndex}, + ), + returnValue: _FakeGenerationContext_16( + this, + Invocation.method( + #$writeInsertable, + [ + table, + insertable, + ], + {#startIndex: startIndex}, + ), + ), + ) as _i3.GenerationContext); + + @override + String $expandVar( + int? start, + int? amount, + ) => + (super.noSuchMethod( + Invocation.method( + #$expandVar, + [ + start, + amount, + ], + ), + returnValue: _i7.dummyValue( + this, + Invocation.method( + #$expandVar, + [ + start, + amount, + ], + ), + ), + ) as String); + + @override + _i6.Future close() => (super.noSuchMethod( + Invocation.method( + #close, + [], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); +} + /// A class which mocks [BackupFileHandler]. /// /// See the documentation for Mockito's code generation for more information.