I have a test that looks like this:
test('should throw error if threshold is null', (){
  final findEngine = new FindEngine<Foo>();
  expect(findEngine.streamResults('foo', null), throwsA(new
      isInstanceOf<ThresholdNullOrOutOfBoundsError>()));
});
The test is failing with the following message:
ERROR: should throw error if threshold is null
  Test failed: Caught Instance of 'ThresholdNullOrOutOfBoundsError'
Am I doing something wrong here?
                        
Figured it out. Needed to close over the call that I expected to fail: