I use the TestCaseSource attribute to generate a dynamic number of tests. NCrunch works well with this except when the number (or order) of tests changes.
NCrunch seems to identify the dynamic tests by order. If I change some code which changes the number or order of the dynamic test cases, then right click and run one of the dynamic tests, NCrunch will not run the test I clicked but instead NCrunch reloads the TestCaseSource data and runs the test for the Nth piece of data, where N is the outdated UI position of the test.
This results in the test name not matching the test results or exception for that row. Also, if one test case is no longer there, NCrunch still shows the same number of tests but fills the ending rows with "This test was not executed during a planned execution run. Ensure your test project is stable and does not contain issues in initialisation/teardown fixtures."
What I would expect is that the UI is updated as soon as the new TestCaseSource data is generated, even if only one dynamic test case is being run.
If I try to run a test that no longer exists, the UI row should silently disappear.
If I try to run a test that still exists but is in a different order, the UI should move the row's position and display the correct results for that test.
If test cases are added when I run a test, it would be nice to also add them in the correct position, showing as never run.
Note that the test names are dynamically generated but are required by all tooling to be unique, so I would expect the UI to identify (reorder, remove and add new tests) matching on the generated unique name.
As it is, the only way I can work reliably around these tests when changing code is to click Resynchronize, rebuild and rerun every time I want to rerun one. Meaning that it's actually more efficient to use ReSharper.
Edited 13 Apr 2016 18:47 UTC