I’ve got lots of unit tests which needs lots of txt, data, html etc. files. Externally storing these files makes life so much easier to update test cases adding new test cases etc.
However having dependencies in Unit Tests brings lots of headache in different systems and in different test runners.
What are the best practices?
- Externally storing them and
relatively linking these files in
the code? (causing problems in some
test runners, or requires extra
configuration) - Embedding all these files in the
Unit Test dlls and read from there
(makes creating tests harder) - Storing in a hardcoded
location(obviously causing so many
problems when you check out the code
in a different place)
How do you solve this problem?
I use a local folder in my test project and get the test files with code like:
Oh yes, I’m using MbUnit.