@@ -113,8 +113,8 @@ public async Task TestInsertRecord()
113
113
cache : SqliteCacheMode . Private
114
114
) ;
115
115
await helper . InitializeDatabaseAsync ( ) ;
116
- await helper . AddOneRecordAsync ( exampleTextRecord ) ;
117
- var c = await helper . GetAllRecordsAsync ( ) ;
116
+ await helper . AddOneRecordAsync ( exampleTextRecord , true ) ;
117
+ var c = await helper . GetAllRecordsAsync ( true ) ;
118
118
var find = false ;
119
119
foreach ( var record in c )
120
120
{
@@ -163,7 +163,7 @@ public async Task TestDeleteRecordBefore(int type, string creatTime, int keepTim
163
163
}
164
164
// helper.Connection.BackupDatabase(new SqliteConnection("Data Source=a.db"));
165
165
await helper . DeleteRecordsByKeepTimeAsync ( type , keepTime ) ;
166
- var recordsAfterDelete = await helper . GetAllRecordsAsync ( ( str ) => _testOutputHelper . WriteLine ( $ "{ str } ") ) ;
166
+ var recordsAfterDelete = await helper . GetAllRecordsAsync ( true , ( str ) => _testOutputHelper . WriteLine ( $ "{ str } ") ) ;
167
167
foreach ( var record in recordsAfterDelete . Where ( r => r . DataType == ( DataType ) type ) )
168
168
{
169
169
var expTime = record . CreateTime + TimeSpan . FromHours ( keepTime ) ;
@@ -187,11 +187,11 @@ public async Task TestPinRecord()
187
187
cache : SqliteCacheMode . Private
188
188
) ;
189
189
await helper . InitializeDatabaseAsync ( ) ;
190
- await helper . AddOneRecordAsync ( exampleTextRecord ) ;
191
- var c1 = ( await helper . GetAllRecordsAsync ( ) ) . First ( ) ;
190
+ await helper . AddOneRecordAsync ( exampleTextRecord , true ) ;
191
+ var c1 = ( await helper . GetAllRecordsAsync ( true ) ) . First ( ) ;
192
192
exampleTextRecord . Pinned = ! exampleTextRecord . Pinned ;
193
193
await helper . PinOneRecordAsync ( exampleTextRecord ) ;
194
- var c2 = ( await helper . GetAllRecordsAsync ( ) ) . First ( ) ;
194
+ var c2 = ( await helper . GetAllRecordsAsync ( true ) ) . First ( ) ;
195
195
Assert . Equal ( c1 . Pinned , ! c2 . Pinned ) ;
196
196
await helper . CloseAsync ( ) ;
197
197
}
@@ -207,9 +207,9 @@ public async Task TestDeleteOneRecord()
207
207
cache : SqliteCacheMode . Private
208
208
) ;
209
209
await helper . InitializeDatabaseAsync ( ) ;
210
- await helper . AddOneRecordAsync ( exampleTextRecord ) ;
210
+ await helper . AddOneRecordAsync ( exampleTextRecord , true ) ;
211
211
await helper . DeleteOneRecordAsync ( exampleTextRecord ) ;
212
- var c = await helper . GetAllRecordsAsync ( ) ;
212
+ var c = await helper . GetAllRecordsAsync ( true ) ;
213
213
Assert . Empty ( c ) ;
214
214
await helper . CloseAsync ( ) ;
215
215
}
@@ -231,7 +231,7 @@ public async Task TestDeleteInvalidRecord()
231
231
{
232
232
var valid = _random . NextDouble ( ) > 0.5 ;
233
233
var exampleTextRecord = GetRandomClipboardData ( valid ) ;
234
- await helper . AddOneRecordAsync ( exampleTextRecord ) ;
234
+ await helper . AddOneRecordAsync ( exampleTextRecord , true ) ;
235
235
if ( valid )
236
236
{
237
237
validNum ++ ;
@@ -244,7 +244,7 @@ public async Task TestDeleteInvalidRecord()
244
244
}
245
245
}
246
246
await helper . DeleteInvalidRecordsAsync ( ) ;
247
- var c = await helper . GetAllRecordsAsync ( ) ;
247
+ var c = await helper . GetAllRecordsAsync ( true ) ;
248
248
_testOutputHelper . WriteLine ( "After Delete Invalid Data" ) ;
249
249
var num = 0 ;
250
250
foreach ( var record in c )
@@ -273,7 +273,7 @@ public async Task TestDeleteUnpinnedRecord()
273
273
var pinned = _random . NextDouble ( ) > 0.5 ;
274
274
var exampleTextRecord = GetRandomClipboardData ( ) ;
275
275
exampleTextRecord . Pinned = pinned ;
276
- await helper . AddOneRecordAsync ( exampleTextRecord ) ;
276
+ await helper . AddOneRecordAsync ( exampleTextRecord , true ) ;
277
277
if ( pinned )
278
278
{
279
279
pinnedNum ++ ;
@@ -286,7 +286,7 @@ public async Task TestDeleteUnpinnedRecord()
286
286
}
287
287
}
288
288
await helper . DeleteUnpinnedRecordsAsync ( ) ;
289
- var c = await helper . GetAllRecordsAsync ( ) ;
289
+ var c = await helper . GetAllRecordsAsync ( true ) ;
290
290
_testOutputHelper . WriteLine ( "After Delete Unpinned Data" ) ;
291
291
var num = 0 ;
292
292
foreach ( var record in c )
0 commit comments