WCF MSMQ 单元测试
我使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现对 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.