nunit-vs-adapter
nunit-vs-adapter copied to clipboard
Run All causes TestFixtureSetUpAttribute to be executed per test, not per class
I have a base class containing methods with TestFixtureSetUpAttribute/TestFixtureTearDown attributes and a child class that contains three tests. If I group the tests by class in Test Explorer and right-click on the class name and select Run, those methods correctly get called only once. If however I click "Run All" at the top, they each get called three times, once per test
I presume that it works correctly if you don't group tests by anything.
We can't do anything about this issue if VS is calling the adapter separately for each test. If that's the case, then NUnit is doing what it should by running the fixture setup and teardown each time. That's what has to happen, for example, when you use the NUnit gui and select a single test to run.
OTOH, if the Test Explorer calls the adapter once for the run, then we should be able to do something about it.
We'll check.
On Tue, Sep 2, 2014 at 3:23 PM, Matthew Lieder [email protected] wrote:
I have a base class containing methods with TestFixtureSetUpAttribute/TestFixtureTearDown attributes and a child class that contains three tests. If I group the tests by class in Test Explorer and right-click on the class name and select Run, those methods correctly get called only once. If however I click "Run All" at the top, they each get called three times, once per test
— Reply to this email directly or view it on GitHub https://github.com/nunit/nunit-vs-adapter/issues/45.
Thanks for the quick reply! The only time it works correctly, besides when running a single test at a time of course, is when I group them actually -- it appears to never work when using the Run All link at the top left.
We'll check it out.
On Tue, Sep 2, 2014 at 7:38 PM, Matthew Lieder [email protected] wrote:
Thanks for the quick reply! The only time it works correctly, besides when running a single test at a time of course, is when I group them actually -- it appears to never work when using the Run All link at the top left.
— Reply to this email directly or view it on GitHub https://github.com/nunit/nunit-vs-adapter/issues/45#issuecomment-54245299 .
If this is confirmed, it's probably also a V3 issue.