|
![](/i/fill.gif) |
Darren New wrote:
> Stephen wrote:
>> The answer is no, you don’t need to retest previously passed tests,
>> that is the whole idea of *unit* tests.
>
> OK, then unit tests aren't "independent" in that sense. I guess the
> advice is to prevent a unit test from relying on stuff left over from a
> previous unit test,
That’s right for each unit test you can and generally must prepare the
data the unit has to test. Sometimes preparing that data is the only way
you can get the error conditions you want to check for.
> so you could in theory run them in any order *if*
> they all pass.
>
You can run them in any order and since they are independent tests they
do not rely on other tests passing or failing. It is hard to separate
them in your mind from the system test where the data created in one
unit test is used as an input in a following test.
--
Best Regards,
Stephen
Post a reply to this message
|
![](/i/fill.gif) |