如何在 Fitnesse 中捕获一般错误异常?
以前在我的 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."]
这并不意外,但如何检查强类型错误异常?请注意,我无法将故障消息包含在检查中,因为它包含更改的日期(我单独检查)。
Previously within my Fitnesse fixture I was specifying an expected WCF exception using:
exception[FaultException]
Since then I have converted the WCF service to return a strongly typed FaultContract. I am now getting the following failure message:
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."]
This is not unexpected but how do I check for strongly typed fault exceptions? Please note I cannot include the fault message as part of the check as it contains a date which changes (I check this separately).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试指定正在生成的异常名称:Exception[FaultException`1]
我添加了一个问题,如果异常类型是通用的,则使用完整的通用类型名称。 http://github.com/jediwhale/fitsharp/issues/issue/44
Try specifying the exception name that's being generated: exception[FaultException`1]
I've added an issue to use the full generic type name if the exception type is generic. http://github.com/jediwhale/fitsharp/issues/issue/44