Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit d07fbc5

Browse files
committed
fix(test): update mockResult initialization and change error type to InvalidInputException
1 parent 3366bda commit d07fbc5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/src/ht_data_postgres_test.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,11 @@ void main() {
248248

249249
group('readAllByQuery', () {
250250
test('should build correct query for `_in` operator', () async {
251-
final mockResult = MockResult();
252-
when(() => mockResult.map(any())).thenReturn([]);
251+
final mockResult = Result(
252+
rows: [],
253+
affectedRows: 0,
254+
schema: ResultSchema([]),
255+
);
253256
when(
254257
() => mockConnection.execute(
255258
any(),
@@ -276,10 +279,10 @@ void main() {
276279
expect(params, {'p0': '1', 'p1': '2', 'p2': '3'});
277280
});
278281

279-
test('should throw ArgumentError for invalid column name', () {
282+
test('should throw InvalidInputException for invalid column name', () {
280283
expect(
281284
() => sut.readAllByQuery({'id; DROP TABLE test_models;': '1'}),
282-
throwsA(isA<ArgumentError>()),
285+
throwsA(isA<InvalidInputException>()),
283286
);
284287
});
285288
});

0 commit comments

Comments
 (0)