I do not think that you will greatly benefit by moving your application classes to a static library. You should also consider that you may want to change your classes when compiling them for testing, for example, by adding additional convenient methods that are not needed for the application, therefore, in the end, placing classes in the library may not help at all, because you will need a special version these classes when running tests.
I would suggest the following as a better option than your methods A and B:
METHOD C
- only one project with three configurations:
- Debugging: Creates a .exe application in debug mode.
- Release: creates your .exe application in release mode.
- Test: creates a unit test structure, replaces your main () application with the main test module ()
If you think you need it, you can split the test target into Debug and Release.
source share