我有一个看起来像这样的测试:
test('should throw error if threshold is null', (){
final findEngine = new FindEngine<Foo>();
expect(findEngine.streamResults('foo', null), throwsA(new
isInstanceOf<ThresholdNullOrOutOfBoundsError>()));
});
测试失败,显示以下消息:
ERROR: should throw error if threshold is null
Test failed: Caught Instance of 'ThresholdNullOrOutOfBoundsError'
我在这里做错了吗?
答案 0 :(得分:0)
想出来。需要关闭我预期会失败的电话:
expect(() => findEngine.streamResults('foo', null), throwsA(new
isInstanceOf<ThresholdNullOrOutOfBoundsError>()));