In order to run classes in order, I need to create AssemblyInfo.cs and add following lines in AssemblyInfo.cs
using Xunit;
//Optional
[assembly: CollectionBehavior(DisableTestParallelization = true)]
//Optional
[assembly: TestCaseOrderer("Xunit.Extensions.Ordering.TestCaseOrderer",
"Xunit.Extensions.Ordering")]
//Optional
[assembly: TestCollectionOrderer("Xunit.Extensions.Ordering.CollectionOrderer",
"Xunit.Extensions.Ordering")]
This causes to run whole framework with only one thread.
I would like to accomplish to put classes in order in selected Collection For instance I have collection ("sequentialRun")
Collection[("sequentialRun"),Order(1)]
Class A{
[Fact]
void test1(){}
[Fact]
void test2(){}
}
Collection[("sequentialRun"),Order(2)]
Class B{
[Fact]
void test1(){}
[Fact]
void test2(){}
}
Class C{
[Fact]
void test1(){}
[Fact]
void test2(){}
}
When I trigger the whole test script in my framework I would like to achieve that A and C starts running together and when A is done then B can start. Is there anyway to accomplish this??
Is it possible to run test classes in order? Without disabling the parallel execution for the whole framework?
I have found this: https://github.com/tomaszeman/Xunit.Extensions.Ordering#test-cases-ordering
In order to run classes in order, I need to create AssemblyInfo.cs and add following lines in AssemblyInfo.cs
using Xunit; //Optional [assembly: CollectionBehavior(DisableTestParallelization = true)] //Optional [assembly: TestCaseOrderer("Xunit.Extensions.Ordering.TestCaseOrderer", "Xunit.Extensions.Ordering")] //Optional [assembly: TestCollectionOrderer("Xunit.Extensions.Ordering.CollectionOrderer", "Xunit.Extensions.Ordering")] This causes to run whole framework with only one thread.
I would like to accomplish to put classes in order in selected Collection For instance I have collection ("sequentialRun")
Collection[("sequentialRun"),Order(1)] Class A{
[Fact] void test1(){} [Fact] void test2(){}
}
Collection[("sequentialRun"),Order(2)] Class B{
[Fact] void test1(){} [Fact] void test2(){} }
Class C{
[Fact] void test1(){} [Fact] void test2(){} } When I trigger the whole test script in my framework I would like to achieve that A and C starts running together and when A is done then B can start. Is there anyway to accomplish this??
Thank you so much!!