저는 연습 문제를 완료하면서 AngularDart 자습서를 통해 작업하고 단위 테스트를 작성하려고합니다.Dart unittest가 도움이되지 않는 결과를 출력합니다.
나는 다음과 같습니다 시험이 있습니다
test('should convert sugar ingredient to maple syrup', inject((SugarFilter filter) {
var r1 = new Recipe(null, null, null, ['has sugar in ingredients '], 'bla', null, null);
var r1New = new Recipe(null, null, null, ['has maple syrup in ingredient '], 'bla', null, null);
var r2 = new Recipe(null, null, null,[ 'has pure ingredients'], 'bla', null, null);
var inList = [r1, r2];
var outList = [r1New, r2];
expect(filter(inList), equals(outList));
}));
시험은이 출력 실패 :
Test failed: Caught Expected: [Instance of 'Recipe', Instance of 'Recipe']
Actual: [Instance of 'Recipe', Instance of 'Recipe']
Which: was <Instance of 'Recipe'> instead of <Instance of 'Recipe'> at location [0]
내가 실패 있는지 확인하는 'categoryFilter'에 대한 기존 테스트를 수정 시도
나는 같은, 오히려 도움이되지 않는 산출을 얻는다.
두 개체의 비교 결과를보다 의미있는 방법으로 출력 할 수 있습니까?