I have an existing application VS 2005.NET Framework Framework VS 2005 in which I want to do some basic refactoring. There is currently no unit testing in place, but I want to add this before messing with the code. I have no practical experience with unit testing, although I know the theory (it just didn’t manage to be implemented, I know: I am ashamed of myself :-)) Here are some questions that I’m thinking about:
a) As a newbie, should I use NUnit or NUnitLite (which is claimed to be easier to use)?
b) Should I aim to run tests on a mobile device or desktop (with the exception of device specific code)? Currently, the desktop looks more attractive, especially for including tests in automated assemblies ...
c) How is the class that I want to test usually included in the test project? My application is a .EXE file, i.e. I can’t just refer to it as a .LLL assembly from a test project (or can I? I have never tried this ...). I checked various NUnit tutorials, but didn’t mention it, not a single tutorial suggested copying and pasting the class that I want to test in a test project (yuk!). Should I reference the source file in my test project? What about private methods or dependencies on other classes?
d) Should I start to modify the source code to provide better testability, for example. make private methods public, separable, etc.? This is a bit like refactoring before I can test, which is not very good for me ... Or is it better not to touch the source code at all in the beginning, even if it means less code coverage, etc.?
e) Should I study any other tools or add-ons that most people use?
Thanks in advance for any answers (I also appreciate the answers if they relate to only one or to some of the above items).
source share