2016-12-02 7 views
0

기대 오류가 발생했습니다. 그리고 클라이언트 서비스도 예외를 throw하지만 예상 한 방식은 아닙니다. 나는 "System.ServiceModel.FaultException"그것을 기대하지만, 나에게이 제공 :단위 테스트이 내 단위 테스트입니다 System.ServiceModel.FaultException

나는 "ExpectedException"그래서 이것은 단위 테스트가 제대로 예상을 제외하고 통과를 넣어 않는 것을
Test method RepoUnitTest_ExpectError threw exception 
System.ServiceModel.FaultException`1[[System.ServiceModel.ExceptionDetail, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], 
but exception System.ServiceModel.FaultException was expected. 

확실하지.

답변

0

이 질문을 게시하기 전에 몇 분 정도 기다려야 했겠지만, 이제는 비슷한 문제를 겪는 사람과 지식을 공유 할 수있게되어 기쁩니다.

예상 예외 (이 특정한 경우에) 이런 식으로 기록한다 :

[ExpectedException(typeof(System.ServiceModel.FaultException< 
System.ServiceModel.ExceptionDetail>))]