Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I mix my UnitTests and my Integration tests in the same project?

I am using NUnit to test my C# code and have so far been keeping unit tests (fast running ones) and integration tests (longer running) separate, and in separate project files. I use NUnit for doing both the unit tests and the integration tests. I just noticed the category attribute that NUnit provides, so that tests can be categorized. This begs the question, should I mix them together and simply use the category attribute to distinguish between them?

like image 883
Fadeproof Avatar asked Feb 03 '23 12:02

Fadeproof


1 Answers

if it is not too difficult to separate them, do so now

unit tests should be run early and often (e.g. every time you change something, before check-in, after check-in), and should complete in a short time-span.

integration tests should be run periodically (daily, for example) but may take significant time and resources to complete

therefore it is best to keep them separate

like image 173
Steven A. Lowe Avatar answered Apr 19 '23 23:04

Steven A. Lowe