@@ -33,55 +33,36 @@ public AssemblySetupFixture()
3333 }
3434
3535 [ AttributeUsage ( AttributeTargets . Assembly , AllowMultiple = true ) ]
36- public class AssemblyFixtureAttribute : Attribute
36+ public class AssemblyFixtureAttribute ( Type fixtureType ) : Attribute
3737 {
38- public AssemblyFixtureAttribute ( Type fixtureType )
39- {
40- FixtureType = fixtureType ;
41- }
42-
43- public Type FixtureType { get ; private set ; }
38+ public Type FixtureType { get ; private set ; } = fixtureType ;
4439 }
4540
46- public class XunitTestFrameworkWithAssemblyFixture : XunitTestFramework
41+ public class XunitTestFrameworkWithAssemblyFixture ( IMessageSink messageSink ) : XunitTestFramework ( messageSink )
4742 {
48- public XunitTestFrameworkWithAssemblyFixture ( IMessageSink messageSink )
49- : base ( messageSink )
50- { }
51-
5243 protected override ITestFrameworkExecutor CreateExecutor ( AssemblyName assemblyName )
5344 => new XunitTestFrameworkExecutorWithAssemblyFixture ( assemblyName , SourceInformationProvider , DiagnosticMessageSink ) ;
5445 }
5546
56- public class XunitTestFrameworkExecutorWithAssemblyFixture : XunitTestFrameworkExecutor
47+ public class XunitTestFrameworkExecutorWithAssemblyFixture ( AssemblyName assemblyName ,
48+ ISourceInformationProvider sourceInformationProvider , IMessageSink diagnosticMessageSink ) : XunitTestFrameworkExecutor ( assemblyName , sourceInformationProvider , diagnosticMessageSink )
5749 {
58- public XunitTestFrameworkExecutorWithAssemblyFixture ( AssemblyName assemblyName ,
59- ISourceInformationProvider sourceInformationProvider , IMessageSink diagnosticMessageSink )
60- : base ( assemblyName , sourceInformationProvider , diagnosticMessageSink )
61- {
62- }
63-
6450 protected override async void RunTestCases ( IEnumerable < IXunitTestCase > testCases ,
6551 IMessageSink executionMessageSink , ITestFrameworkExecutionOptions executionOptions )
6652 {
67- using (
68- var assemblyRunner = new XunitTestAssemblyRunnerWithAssemblyFixture ( TestAssembly , testCases ,
69- DiagnosticMessageSink , executionMessageSink , executionOptions ) )
70- await assemblyRunner . RunAsync ( ) ;
53+ using var assemblyRunner = new XunitTestAssemblyRunnerWithAssemblyFixture ( TestAssembly , testCases ,
54+ DiagnosticMessageSink , executionMessageSink , executionOptions ) ;
55+ await assemblyRunner . RunAsync ( ) ;
7156 }
7257 }
7358
74- public class XunitTestAssemblyRunnerWithAssemblyFixture : XunitTestAssemblyRunner
59+ public class XunitTestAssemblyRunnerWithAssemblyFixture ( ITestAssembly testAssembly ,
60+ IEnumerable < IXunitTestCase > testCases ,
61+ IMessageSink diagnosticMessageSink ,
62+ IMessageSink executionMessageSink ,
63+ ITestFrameworkExecutionOptions executionOptions ) : XunitTestAssemblyRunner ( testAssembly , testCases , diagnosticMessageSink , executionMessageSink , executionOptions )
7564 {
76- readonly Dictionary < Type , object > assemblyFixtureMappings = new Dictionary < Type , object > ( ) ;
77-
78- public XunitTestAssemblyRunnerWithAssemblyFixture ( ITestAssembly testAssembly ,
79- IEnumerable < IXunitTestCase > testCases ,
80- IMessageSink diagnosticMessageSink ,
81- IMessageSink executionMessageSink ,
82- ITestFrameworkExecutionOptions executionOptions )
83- : base ( testAssembly , testCases , diagnosticMessageSink , executionMessageSink , executionOptions )
84- { }
65+ readonly Dictionary < Type , object > assemblyFixtureMappings = new ( ) ;
8566
8667 protected override async Task AfterTestAssemblyStartingAsync ( )
8768 {
@@ -118,24 +99,17 @@ protected override Task<RunSummary> RunTestCollectionAsync(IMessageBus messageBu
11899 => new XunitTestCollectionRunnerWithAssemblyFixture ( assemblyFixtureMappings , testCollection , testCases , DiagnosticMessageSink , messageBus , TestCaseOrderer , new ExceptionAggregator ( Aggregator ) , cancellationTokenSource ) . RunAsync ( ) ;
119100 }
120101
121- public class XunitTestCollectionRunnerWithAssemblyFixture : XunitTestCollectionRunner
102+ public class XunitTestCollectionRunnerWithAssemblyFixture ( Dictionary < Type , object > assemblyFixtureMappings ,
103+ ITestCollection testCollection ,
104+ IEnumerable < IXunitTestCase > testCases ,
105+ IMessageSink diagnosticMessageSink ,
106+ IMessageBus messageBus ,
107+ ITestCaseOrderer testCaseOrderer ,
108+ ExceptionAggregator aggregator ,
109+ CancellationTokenSource cancellationTokenSource ) : XunitTestCollectionRunner ( testCollection , testCases , diagnosticMessageSink , messageBus , testCaseOrderer , aggregator , cancellationTokenSource )
122110 {
123- readonly Dictionary < Type , object > assemblyFixtureMappings ;
124- readonly IMessageSink diagnosticMessageSink ;
125-
126- public XunitTestCollectionRunnerWithAssemblyFixture ( Dictionary < Type , object > assemblyFixtureMappings ,
127- ITestCollection testCollection ,
128- IEnumerable < IXunitTestCase > testCases ,
129- IMessageSink diagnosticMessageSink ,
130- IMessageBus messageBus ,
131- ITestCaseOrderer testCaseOrderer ,
132- ExceptionAggregator aggregator ,
133- CancellationTokenSource cancellationTokenSource )
134- : base ( testCollection , testCases , diagnosticMessageSink , messageBus , testCaseOrderer , aggregator , cancellationTokenSource )
135- {
136- this . assemblyFixtureMappings = assemblyFixtureMappings ;
137- this . diagnosticMessageSink = diagnosticMessageSink ;
138- }
111+ readonly Dictionary < Type , object > assemblyFixtureMappings = assemblyFixtureMappings ;
112+ readonly IMessageSink diagnosticMessageSink = diagnosticMessageSink ;
139113
140114 protected override Task < RunSummary > RunTestClassAsync ( ITestClass testClass , IReflectionTypeInfo @class , IEnumerable < IXunitTestCase > testCases )
141115 {
0 commit comments