Updated test cases

This commit is contained in:
thomashii@dukefirehawk.com 2021-05-06 13:00:00 +08:00
parent bdefa92f91
commit 05bea04db7
2 changed files with 8 additions and 4 deletions

View file

@ -37,7 +37,7 @@
* Migrated angel_orm_generator to 4.0.0 (0/0 tests passed)
* Migrated angel_migration_runner to 3.0.0 (0/0 tests passed)
* Migrated angel_orm_test to 3.0.0 (0/0 tests passed)
* Migrated angel_orm_postgres to 3.0.0 (48/54 tests passed)
* Migrated angel_orm_postgres to 3.0.0 (50/54 tests passed)
* Update orm-sdk-2.12.x boilerplate (in progress) <= Milestone 2

View file

@ -38,7 +38,11 @@ hasMapTests(FutureOr<QueryExecutor> Function() createExecutor,
var model = modelOpt.value;
print(model.toJson());
query = HasMapQuery()..values.copyFrom(model);
expect(await query.updateOne(executor), model);
var result = await query.updateOne(executor);
expect(result.isPresent, true);
result.ifPresent((m) {
expect(m, model);
});
}
});
@ -70,12 +74,12 @@ hasMapTests(FutureOr<QueryExecutor> Function() createExecutor,
test('list equals', () async {
var query = HasMapQuery();
query.where!.list.equals(['1', 2, 3.0]);
query.where?.list.equals(['1', 2, 3.0]);
var result = await query.get(executor);
expect(result, [initialValue]);
query = HasMapQuery();
query.where!.list.equals(['10', 20, 30.0]);
query.where?.list.equals(['10', 20, 30.0]);
var result2 = await query.get(executor);
expect(result2, isEmpty);
});