TestCaseSource is evaluated for each Test Method using it separately
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnit Framework |
New
|
Undecided
|
Unassigned |
Bug Description
If a TestCaseSource is used by a number of TestMethods, the TestCaseSource is evaluated for each test method separately.
Though theoretically it could be useful in extreme cases, like timestamp of the test case source evaluation, in majority of cases, the TestCaseSource should be evaluated only once. It is necessary to evaluate the chances of the extreme cases as their code could break if this behavior is reversed.
Evaluating TestCaseSource only once would dramatically speed up running of slow TestCaseSources shared by number of TestMethods as they would be evaluated only once and each subsequent use of TestCaseSource would use only the previously calculated value.
Implementation is simple via a dictionary / cache / singleton.