如何在 Fitnesse 中捕获一般错误异常?

发布于 2024-08-25 04:59:56 字数 424 浏览 2 评论 0原文

以前在我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泅人 2024-09-01 04:59:56

尝试指定正在生成的异常名称: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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文