简体   繁体   中英

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

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.

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.

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会引发异常。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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