88using System . Threading . Tasks ;
99using Microsoft . CodeAnalysis ;
1010using Xunit ;
11+ using System . Threading ;
12+ using Microsoft . CodeAnalysis . Formatting ;
13+ using Microsoft . CodeAnalysis . Text ;
1114
12- namespace Microsoft . DotNet . CodeFormatting . Tests
15+ namespace XUnitConverter . Tests
1316{
14- public class UsesXunitForTestsFormattingRuleTests : GlobalSemanticRuleTestBase
17+ public class MSTestToXUnitConverterTests : ConverterTestBase
1518 {
16- internal override IGlobalSemanticFormattingRule Rule
19+ protected override XUnitConverter . ConverterBase CreateConverter ( )
1720 {
18- get { return new Rules . UsesXunitForTestsFormattingRule ( new Options ( ) ) ; }
21+ return new XUnitConverter . MSTestToXUnitConverter ( ) ;
1922 }
2023
2124 [ Fact ]
22- public void TestUpdatesUsingStatements ( )
25+ public async Task TestUpdatesUsingStatements ( )
2326 {
2427 var text = @"
2528using System;
@@ -38,11 +41,11 @@ namespace System.Composition.UnitTests
3841{
3942}
4043" ;
41- Verify ( text , expected ) ;
44+ await Verify ( text , expected ) ;
4245 }
4346
4447 [ Fact ]
45- public void TestUpdatesUsingStatementsWithIfDefs ( )
48+ public async Task TestUpdatesUsingStatementsWithIfDefs ( )
4649 {
4750 var text = @"
4851using System;
@@ -67,11 +70,11 @@ namespace System.Composition.UnitTests
6770{
6871}
6972" ;
70- Verify ( text , expected ) ;
73+ await Verify ( text , expected ) ;
7174 }
7275
7376 [ Fact ]
74- public void TestRemovesTestClassAttributes ( )
77+ public async Task TestRemovesTestClassAttributes ( )
7578 {
7679 var text = @"
7780using System;
@@ -97,11 +100,11 @@ public class MyTestClass
97100 }
98101}
99102" ;
100- Verify ( text , expected ) ;
103+ await Verify ( text , expected ) ;
101104 }
102105
103106 [ Fact ]
104- public void TestUpdatesTestMethodAttributes ( )
107+ public async Task TestUpdatesTestMethodAttributes ( )
105108 {
106109 var text = @"
107110using System;
@@ -134,11 +137,11 @@ public void MyTestMethod()
134137 }
135138}
136139" ;
137- Verify ( text , expected ) ;
140+ await Verify ( text , expected ) ;
138141 }
139142
140143 [ Fact ]
141- public void TestUpdatesAsserts ( )
144+ public async Task TestUpdatesAsserts ( )
142145 {
143146 var text = @"
144147using System;
@@ -191,19 +194,7 @@ public void MyTestMethod()
191194 }
192195}
193196" ;
194- Verify ( text , expected ) ;
195- }
196-
197- private static readonly MetadataReference s_MSTestReference = MetadataReference . CreateFromAssembly ( typeof ( VisualStudio . TestTools . UnitTesting . TestMethodAttribute ) . Assembly ) ;
198- private static readonly MetadataReference s_XunitReference = MetadataReference . CreateFromAssembly ( typeof ( FactAttribute ) . Assembly ) ;
199-
200- protected override IEnumerable < MetadataReference > GetSolutionMetadataReferences ( )
201- {
202- return base . GetSolutionMetadataReferences ( )
203- . Concat ( new [ ] {
204- s_MSTestReference ,
205- s_XunitReference
206- } ) ;
197+ await Verify ( text , expected ) ;
207198 }
208199 }
209200}
0 commit comments