add tests for bulk replace

This commit is contained in:
Moshe Dicker 2024-04-17 13:56:45 -04:00
parent 1a68efce58
commit 4c4122f52c
1 changed files with 18 additions and 0 deletions

View File

@ -105,6 +105,24 @@ void main() {
.then((value) => value.description),
completion("Hello"));
// Bulk Replace
await db.managers.categories.bulkReplace([
obj1.copyWith(description: "Hello"),
obj2.copyWith(description: "World")
]);
expect(
db.managers.categories
.filter(((f) => f.id(obj1.id)))
.getSingle()
.then((value) => value.description),
completion("Hello"));
expect(
db.managers.categories
.filter(((f) => f.id(obj2.id)))
.getSingle()
.then((value) => value.description),
completion("World"));
// Update All Rows
final update2 = db.managers.categories
.update((o) => o(priority: Value(CategoryPriority.high)));