66using Microsoft . ApplicationInspector . Logging ;
77using Microsoft . Extensions . Logging ;
88using Microsoft . Extensions . Logging . Abstractions ;
9- using Microsoft . VisualStudio . TestTools . UnitTesting ;
9+ using Xunit ;
1010
1111namespace AppInspector . Tests . Commands ;
1212
1313/// <summary>
1414/// Test class for TagDiff Command
1515/// </summary>
16- [ TestClass ]
1716[ ExcludeFromCodeCoverage ]
1817public class TestTagDiffCmd
1918{
@@ -25,8 +24,7 @@ public class TestTagDiffCmd
2524 private static string testFileFourWindowsOneLinuxPath = string . Empty ;
2625 private static string testRulesPath = string . Empty ;
2726
28- [ ClassInitialize ]
29- public static void InitOutput ( TestContext testContext )
27+ public TestTagDiffCmd ( )
3028 {
3129 loggerFactory = logOptions . GetLoggerFactory ( ) ;
3230 testFileFourWindowsOneLinuxPath =
@@ -40,9 +38,9 @@ public static void InitOutput(TestContext testContext)
4038 testRulesPath = Path . Combine ( "TestData" , "TestTagDiffCmd" , "Rules" , "FindWindows.json" ) ;
4139 }
4240
43- [ DataRow ( TagTestType . Equality , TagDiffResult . ExitCode . TestPassed ) ]
44- [ DataRow ( TagTestType . Inequality , TagDiffResult . ExitCode . TestFailed ) ]
45- [ TestMethod ]
41+ [ InlineData ( TagTestType . Equality , TagDiffResult . ExitCode . TestPassed ) ]
42+ [ InlineData ( TagTestType . Inequality , TagDiffResult . ExitCode . TestFailed ) ]
43+ [ Theory ]
4644 public void Equality ( TagTestType tagTestType , TagDiffResult . ExitCode expectedExitCode )
4745 {
4846 TagDiffOptions options = new ( )
@@ -58,12 +56,12 @@ public void Equality(TagTestType tagTestType, TagDiffResult.ExitCode expectedExi
5856 TagDiffCommand command = new ( options , loggerFactory ) ;
5957 var result = command . GetResult ( ) ;
6058
61- Assert . AreEqual ( expectedExitCode , result . ResultCode ) ;
59+ Assert . Equal ( expectedExitCode , result . ResultCode ) ;
6260 }
6361
64- [ DataRow ( TagTestType . Equality , TagDiffResult . ExitCode . TestFailed ) ]
65- [ DataRow ( TagTestType . Inequality , TagDiffResult . ExitCode . TestPassed ) ]
66- [ TestMethod ]
62+ [ InlineData ( TagTestType . Equality , TagDiffResult . ExitCode . TestFailed ) ]
63+ [ InlineData ( TagTestType . Inequality , TagDiffResult . ExitCode . TestPassed ) ]
64+ [ Theory ]
6765 public void Inequality ( TagTestType tagTestType , TagDiffResult . ExitCode expectedExitCode )
6866 {
6967 TagDiffOptions options = new ( )
@@ -79,10 +77,10 @@ public void Inequality(TagTestType tagTestType, TagDiffResult.ExitCode expectedE
7977 TagDiffCommand command = new ( options , loggerFactory ) ;
8078 var result = command . GetResult ( ) ;
8179
82- Assert . AreEqual ( expectedExitCode , result . ResultCode ) ;
80+ Assert . Equal ( expectedExitCode , result . ResultCode ) ;
8381 }
8482
85- [ TestMethod ]
83+ [ Fact ]
8684 public void InvalidSourcePath_Fail ( )
8785 {
8886 TagDiffOptions options = new ( )
@@ -92,10 +90,10 @@ public void InvalidSourcePath_Fail()
9290 FilePathExclusions = Array . Empty < string > ( ) //allow source under unittest path
9391 } ;
9492 var cmd = new TagDiffCommand ( options , loggerFactory ) ;
95- Assert . ThrowsException < OpException > ( ( ) => cmd . GetResult ( ) ) ;
93+ Assert . Throws < OpException > ( ( ) => cmd . GetResult ( ) ) ;
9694 }
9795
98- [ TestMethod ]
96+ [ Fact ]
9997 public void NoDefaultNoCustomRules_Fail ( )
10098 {
10199 TagDiffOptions options = new ( )
@@ -107,6 +105,6 @@ public void NoDefaultNoCustomRules_Fail()
107105 } ;
108106
109107 var command = new TagDiffCommand ( options , loggerFactory ) ;
110- Assert . ThrowsException < OpException > ( ( ) => command . GetResult ( ) ) ;
108+ Assert . Throws < OpException > ( ( ) => command . GetResult ( ) ) ;
111109 }
112110}
0 commit comments