2

以前在我的 Fitnesse 夹具中,我使用以下方法指定了预期的 WCF 异常:

exception[FaultException]

从那以后,我将 WCF 服务转换为返回强类型的 FaultContract。我现在收到以下失败消息:

exception[FaultException`1: "A file with the name DMS Documents/testFileWord.doc already exists. It was last modified by SHAREPOINT\system on 09 Mar 2010 15:36:14 -0000."] 

这并不意外,但如何检查强类型错误异常?请注意,我不能将故障消息包含在检查中,因为它包含更改的日期(我单独检查)。

4

1 回答 1

3

尝试指定正在生成的异常名称:exception[FaultException`1]

如果异常类型是泛型,我添加了一个使用完整泛型类型名称的问题。http://github.com/jediwhale/fitsharp/issues/issue/44

于 2010-03-11T05:46:38.660 回答