2014-12-14 1 views
0

I는 다음과 같습니다 시험이 있습니다테스트는 기대가 충족하더라도 실패

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

알아 냈어. 실패 할 것으로 예상되는 통화를 종료해야합니다.

expect(() => findEngine.streamResults('foo', null), throwsA(new 
    isInstanceOf<ThresholdNullOrOutOfBoundsError>()));