Write integration test for Dart templates

This commit is contained in:
Simon Binder 2019-09-14 16:48:51 +02:00
parent 349b245089
commit 29c0cdaf3f
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
1 changed files with 13 additions and 0 deletions

View File

@ -54,4 +54,17 @@ void main() {
await db.into(db.mytable).insert(const MytableCompanion());
verify(mock.runInsert('INSERT INTO mytable DEFAULT VALUES', []));
});
test('runs queries with arrays and Dart templates', () async {
final mock = MockExecutor();
final db = CustomTablesDb(mock);
await db.readMultiple(['a', 'b'],
OrderBy([OrderingTerm(expression: db.config.configKey)])).get();
verify(mock.runSelect(
'SELECT * FROM config WHERE config_key IN (?1, ?2) ORDER BY config_key ASC',
['a', 'b'],
));
});
}