DEV Community

Afshar Mohebi
Afshar Mohebi

Posted on

Integration test with xUnit

Tests is one of those thing that people get interested in and forget again. I don't know why. Maybe in the field of custom software development, software engineers do not need high quality. Another guess is that, it make the software more expensive. Do not forget that some people believe in magic. They do not think a not-tested software will fail somewhere down the road. A more reasonable excuse, in my point of view, is that in a given society you seldom can work up the common standards. When things on other industries are not checked against failures enough, you will not be interested to have better quality in your software.

I (we) am not an exception. Either in personal projects or team projects, I start testing seriously, but after a while, all the plans fade. The project comes in a critical point in which client wants it soon. Or, another project gets started while no new developer is available. Then what happens is that tests are not continued any more.

In the recent years, once I used JMeter for load testing. It did not continue forever, however it revealed some serious flaws. Also helped re-generating the error so colleague were able to resolve the problem. In the past, I used to utilize old school NUnit to do unit tests. Those days, DI/IoC was not common, even so interfaces or mocking, so it was hard to test every corner of the code.

These days, in the era of .Net Core 3.x, I have explored xUnit which is very similar to NUnit. Using xUnit, I do both unit testing and integration testing. The good news is that I can use Entity Framework in memory for a far better performance. In the past I use SQLite for the same requirement, but now it does the work good. There is also a Test Server which I am not familiar enough. But, I hope I can fully utilize it soon.

With these tools I do both unit test and integration test. I feel, people are better convince with the integration tests.

Discussion (0)