Perhaps you should first take a step back and ask a few questions.
- What is the most important part to test?
- How hard is it to set up this test?
- Is the cost of installing a test to get test results?
- Can I get most of what I wanted to test with a simpler test?
In any case, I would use a device based on real data and the expectation that this data will become. This allows our test to be deterministic and therefore automated.
If the most important part is the piece of logic that can be tested through unit test with known I / O and mocks.
If testing the integration part is really the most important, I will try to find a balance between mocking the number of moving parts, how I felt comfortable to make a more manageable test.
The more network resources you use a more complex system, the more tests it should have. You need to think about time issues, uptime, timeouts, error conditions, etc. You can also fall into the trap of creating a test that is non-deterministic. If your statement ends with a search for timing differences, rely on certain timings or rely on an unreliable service that breaks down a lot; than you can get a test that is useless due to the amount of "noise" from false positive interruptions.
If you want to move towards the use of a continuous integration model, you will also need to consider the complexity of control (start and shutdown) or several processes with each test run. In general, you get a simpler test for management, if you can conduct the test as a single process, and other "processes" are calling functions at the corresponding starting points of the code.
source share