vendredi 24 juillet 2020

c# Nunit parallel test cases

i try to run few test cases in parallel and it don't work well. i want run in parallel test cases but each test case that run in parallel run with test case from anoter test and not with test case from same test.

i have 2 tests in same class and for each test i have a few test cases:

 [TestFixture] 
 [Parallelizable(ParallelScope.All)] 
 [Category("example_category")]
 public class example
 {
    [Test] 
    [TestCase(param1, param2)]   
    [TestCase(param1, param2)] 
    public void test1(object param1, object param2){
        // do some stuff
    }

    [Test] 
    [TestCase(param1, param2)]   
    [TestCase(param1, param2)] 
    public void test2(object param1, object param2){
        // do some stuff
    } 
 }

now all tests run in parallel but i get a lot of errors, what i want to do is run in parallel test cases from another tests. for example: i want test case from test1 run in parallel with test case from test2, but now 2 test case of test1 run in parallel and i want to avoid from this. how i can fix my code to do it right?

thanks!

Aucun commentaire:

Enregistrer un commentaire