Is there a way to check if there's more tests to be run during an execution? #4272
-
I have certains functions that run at the beginning and end of an execution which I have currently placed in a BaseTest class within the OneTimeSetUp and OneTimeTearDown methods. Since I distribute this as a NuGet package to be used in other projects, I haven't been able to leverage the SetUpFixture as a solution to this because namespaces will be different. Since I dont want these functions running between fixtures and only once per execution, we currently just dont break up our fixtures and have just 2 fixture files that we never run together, 1 for smoke and 1 for regression. I would like to be able to break these up but need a way to prevent the code in onetimesetup/onetimeteardown from running more than once if tests from different fixtures are selected to run. So question is ... if there is a way to check if there are more tests to be run by the NUnit executor or if there is a way to get the filtered number of tests count, or perhaps there's a better approach that I'm not using? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Sorry, this was missed. |
Beta Was this translation helpful? Give feedback.
Thanks for reply that's pretty much the solution I settled on I created the untagged onetimesetup and onetimeteardown functions in a base class that the client projects inherit and call into from a setup fixture with the actual onetime attribute functions.