简体   繁体   English

通信模块自动化测试

[英]Communication Module Automation Testing

I developed a communication protocol module between two machine in our product. 我在我们的产品中开发了两台机器之间的通信协议模块。 It is an explicit protocol and it was not possible to use standart protocol like WCF or WebServices 它是一个显式协议,不可能使用像WCF或WebServices这样的标准协议

There are two functionalities for this module: 1. Send notification from end point 1 to end point 2 2. Send Request from end point 1 to end point 2 and receive response from end point 2 in end point 1. 此模块有两个功能:1。从结束点1发送通知到结束点2 2.从结束点1发送请求到结束点2并从结束点1的结束点2接收响应。

Before we are doing full integration tests between those two machines (the other side is written in C++) I wrote a client console and server console to simulate manually the two main funcionalities over the local tcp in my localhost. 在我们在这两台机器之间进行完全集成测试之前(另一方是用C ++编写的)我编写了一个客户端控制台和服务器控制台,以便在我的localhost中手动模拟本地tcp上的两个主要功能。

What is the best way to automate this test in the solution build process? 在解决方案构建过程中自动执行此测试的最佳方法是什么? I tries to use unit test framework but it didnt worked so well. 我尝试使用单元测试框架,但它没有很好地工作。 When using unit tests framework i had to run the client and server in two different threads and it didnt go so fluently... 当使用单元测试框架时,我必须在两个不同的线程中运行客户端和服务器,它没有那么流畅......

您可以在单元测试中使用模拟框架(如Moq)来模拟与端点2的连接。这将允许您测试端点1对端点2的所有可能类型的响应的行为是否正常。例如,如果端点1无法连接到端点2,则会断言端点1会引发异常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM