I want to ask your advice in making a decision with one issue related to
ReSharper's unit test runner. The question is whether we should build projects
before running/debugging unit tests. Currently we do not build the project(s)
automatically when invoking "Run" or "Debug" from the Unit Test Runner window
(but build when invoking from the source code or Solution Explorer). But
this solution does not seem to be a good one (see below).
Below there are four solutions (including the currently implemented one)
that I can imagine:
1. Always build the project(s) before running/debugging unit tests.
Positive: always correct results, not confusing for users.
Negative: building projects may consume significant time (tens of seconds
in our case) even in case there were no changes at all.
2. (Currently implemented.) Do not build the project(s) automatically when
invoking "Run" or "Debug" from the Unit Test Runner window. There is a button
"Build Projects" right in the Unit Test Runner window that builds the corresponding
Positive: no time spent for unnecessary build.
Negative: in case when the build is required, running unit tests from the
Unit Test Runner window requires 2 steps (both time consuming!): press "Build
Projects" (and wait), press "Run"/"Debug" (and wait again). It would be better
to have only one time cosuming step so that user can invoke it and switch
to some other activity for some period of time.
3. Have a toogle button "Build Project(s) before Run" in the Unit Test Runner
Positive: the same as in #2 and it's negative side is avoided.
Negative: in case when the solution is big and I want to avoid unnecessary
building I need to check the button state before invoking Run or Debug.
4. Have a toogle button "Build Project(s) before Next Run" in the Unit Test
Runner window. Pressing this button affects the next Run/Debug from the window
and then button automatically untoggles.
Positive: the same as in #3 and I should not check the button state, I
should press it if I want to build the changes and should not do anything
Negative: a but complicated and non-intuitive behavior with the button
which untoggles automatically.
I, personnally, find #4 to be the most convenient solution for me. What do
Chief Scientist, Vice President of Product Development
"Develop with pleasure!"