WCF MSMQ 单元测试

发布于 2024-08-30 01:20:25 字数 161 浏览 9 评论 0原文

我使用 WCF 创建了一个自定义 msmq 服务,它使用自定义绑定,因为它需要在通道层执行一些自定义逻辑,在通道层调用另一个 wcf 服务。该服务将成为未来几年我们系统的核心功能。我想尽我所能确保服务稳健,但是,我不知道从哪里开始。即测试响应,我应该创建一个模拟队列对象吗?如何测试该服务正在调用另一个服务?

I have created a custom msmq service with WCF, which uses a custom binding as it needs to do some custom logic at the channel layer, where it calls another wcf service. The service is going to be a core pience of functionality for our systems for at the the next few years. i want to do what I can to make sure the service is robust, but, i'm not sure where to start. Ie testing the response, should I create a mock queue object? how do I test the service is calling another service ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

牛↙奶布丁 2024-09-06 01:20:25

我发现对 msmq 服务进行单元测试的最佳方法是实际对服务实现进行单元测试,然后使用 msmq 和模拟存储库进行集成测试。查看写入是否有效。

Best way I have found to unit test msmq services is to actually unit test the service implementation, then do an integration test using msmq with a mock repository. To see if writes are working.

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