I have a question concerning visual studios built in test suite.
Is VS studio running these tests with some special compiler flags applied?
The problem description is as following.
I have overloaded the Equals function on one of my classes.
During test runs it would be nice, if it could give me some additional information, which members in the class aren’t equal at all.
Therefore I’d like to implement some messages only if the application is running in test mode.
Thanks for any reply!
Andreas
VS compiles/builds the projects with the currently selected build configuration. So a solution might be to create a separate build configuration yourself, and then use a constant (e.g. TEST) for the projects in that particular build configuration. The output method execution can then be restricted either with the
#if TESTdirective or with the[Conditional("TEST")]attribute. You could configure your build server te allways run the tests with that particual build configuration, so you would see additional output. You would however need to switch between the build configurations manually when running the tests from VS