i want to run all tests 1 time. One method will run after all tests are finished. This test will change the language of the application. How can I start all tests from scratch?
Asked
Active
Viewed 120 times
0
-
Does this answer your question? [How do I run a set of nUnit tests with two different setups?](https://stackoverflow.com/questions/2388489/how-do-i-run-a-set-of-nunit-tests-with-two-different-setups) – Franz Gleichmann Jun 11 '21 at 08:25
-
same tests will run – Mehmet Ceylan Jun 11 '21 at 08:54
1 Answers
1
If you want all tests for one language to run and complete before the second run begins, this is best done outside of NUnit in the script that runs your tests. Just run NUnit twice, passing the language to it as a parameter each time through the --testparm
option, e.g. --testparam lang=en-US
.
In your test code, use a global OneTimeSetUp
to read the parameter value and then set the language for the rest of the run. Using the above example, you would access the language parameter using TestContext.TestParameters["lang"]`.
Note that there are other ways to do this if you don't require the tests for one language to complete before the next set starts.

Charlie
- 12,928
- 1
- 27
- 31