11using System ;
22using System . Collections . Generic ;
33using System . Runtime . InteropServices ;
4- using Microsoft . VisualStudio . TestTools . UnitTesting ;
54using net . r_eg . EvMSBuild . Exceptions ;
65using net . r_eg . vsSBE . Actions ;
76using net . r_eg . vsSBE . Events ;
7+ using Xunit ;
88
99namespace net . r_eg . vsSBE . Test . Actions
1010{
11- [ TestClass ]
1211 public class DTEOperationTest
1312 {
14- [ TestMethod ]
13+ [ Fact ]
1514 public void dtePreparedTest ( )
1615 {
17- DTEOperation target = new DTEOperation ( ( IEnvironment ) null , SolutionEventType . General ) ;
16+ DTEOperation target = new ( null , SolutionEventType . General ) ;
1817
1918 string line = "File.OpenProject(\" c:\\ path\\ app.sln\" )" ;
2019 DTEOperation . DTEPrepared actual = target . parse ( line ) ;
2120
22- Assert . AreEqual ( "File.OpenProject" , actual . name ) ;
23- Assert . AreEqual ( "\" c:\\ path\\ app.sln\" " , actual . args ) ;
21+ Assert . Equal ( "File.OpenProject" , actual . name ) ;
22+ Assert . Equal ( "\" c:\\ path\\ app.sln\" " , actual . args ) ;
2423 }
2524
26- [ TestMethod ]
25+ [ Fact ]
2726 public void dtePreparedTest2 ( )
2827 {
29- DTEOperation target = new DTEOperation ( ( IEnvironment ) null , SolutionEventType . General ) ;
28+ DTEOperation target = new ( null , SolutionEventType . General ) ;
3029
3130 string line = "Debug.StartWithoutDebugging" ;
3231 DTEOperation . DTEPrepared actual = target . parse ( line ) ;
3332
34- Assert . AreEqual ( "Debug.StartWithoutDebugging" , actual . name ) ;
35- Assert . AreEqual ( "" , actual . args ) ;
33+ Assert . Equal ( "Debug.StartWithoutDebugging" , actual . name ) ;
34+ Assert . Equal ( string . Empty , actual . args ) ;
3635 }
3736
38- [ TestMethod ]
39- [ ExpectedException ( typeof ( IncorrectSyntaxException ) ) ]
40- public void dtePreparedTest3 ( )
37+ [ Theory ]
38+ [ InlineData ( "Debug StartWithoutDebugging" ) ]
39+ [ InlineData ( "" ) ]
40+ public void dtePreparedTheory1 ( string line )
4141 {
42- DTEOperation target = new DTEOperation ( ( IEnvironment ) null , SolutionEventType . General ) ;
42+ DTEOperation target = new ( null , SolutionEventType . General ) ;
4343
44- string line = "Debug StartWithoutDebugging" ;
45- DTEOperation . DTEPrepared actual = target . parse ( line ) ;
44+ Assert . Throws < IncorrectSyntaxException > ( ( ) => target . parse ( line ) ) ;
4645 }
4746
48- [ TestMethod ]
49- [ ExpectedException ( typeof ( IncorrectSyntaxException ) ) ]
50- public void dtePreparedTest4 ( )
51- {
52- DTEOperation target = new DTEOperation ( ( IEnvironment ) null , SolutionEventType . General ) ;
53-
54- string line = "" ;
55- DTEOperation . DTEPrepared actual = target . parse ( line ) ;
56- }
57-
58- [ TestMethod ]
47+ [ Fact ]
5948 public void dtePreparedTest5 ( )
6049 {
6150 DTEOperation target = new DTEOperation ( ( IEnvironment ) null , SolutionEventType . General ) ;
6251
6352 string line = " OpenProject(arg) " ;
6453 DTEOperation . DTEPrepared actual = target . parse ( line ) ;
6554
66- Assert . AreEqual ( "OpenProject" , actual . name ) ;
67- Assert . AreEqual ( "arg" , actual . args ) ;
55+ Assert . Equal ( "OpenProject" , actual . name ) ;
56+ Assert . Equal ( "arg" , actual . args ) ;
6857 }
6958
70- [ TestMethod ]
59+ [ Fact ]
7160 public void execTest ( )
7261 {
73- DTEOperationAccessor . ToExec target = new DTEOperationAccessor . ToExec ( - 1 ) ;
62+ DTEOperationAccessor . ToExec target = new ( - 1 ) ;
7463
75- Queue < DTEOperation . DTEPrepared > commands = new Queue < DTEOperation . DTEPrepared > ( ) ;
64+ Queue < DTEOperation . DTEPrepared > commands = new ( ) ;
7665 commands . Enqueue ( new DTEOperation . DTEPrepared ( "Build.Cancel" , "" ) ) ;
7766 commands . Enqueue ( new DTEOperation . DTEPrepared ( "File.OpenProject" , "app.sln" ) ) ;
7867 commands . Enqueue ( new DTEOperation . DTEPrepared ( "Debug.Start" , "" ) ) ;
@@ -83,14 +72,14 @@ public void execTest()
8372 target . exec ( commands , false ) ;
8473
8574 Queue < DTEOperation . DTEPrepared > actual = target . getExecuted ( ) ;
86- Assert . IsTrue ( actual . Count == expected . Length ) ;
75+ Assert . True ( actual . Count == expected . Length ) ;
8776
8877 foreach ( DTEOperation . DTEPrepared obj in expected ) {
89- Assert . AreEqual ( actual . Dequeue ( ) , obj ) ;
78+ Assert . Equal ( actual . Dequeue ( ) , obj ) ;
9079 }
9180 }
9281
93- [ TestMethod ]
82+ [ Fact ]
9483 public void execTest2 ( )
9584 {
9685 DTEOperationAccessor . ToExec target = new DTEOperationAccessor . ToExec ( 1 ) ;
@@ -111,14 +100,14 @@ public void execTest2()
111100 }
112101
113102 Queue < DTEOperation . DTEPrepared > actual = target . getExecuted ( ) ;
114- Assert . IsTrue ( actual . Count == expected . Length ) ;
103+ Assert . True ( actual . Count == expected . Length ) ;
115104
116105 foreach ( DTEOperation . DTEPrepared obj in expected ) {
117- Assert . AreEqual ( actual . Dequeue ( ) , obj ) ;
106+ Assert . Equal ( actual . Dequeue ( ) , obj ) ;
118107 }
119108 }
120109
121- [ TestMethod ]
110+ [ Fact ]
122111 public void execTest3 ( )
123112 {
124113 DTEOperationAccessor . ToExec target = new DTEOperationAccessor . ToExec ( 2 ) ;
@@ -140,12 +129,12 @@ public void execTest3()
140129 }
141130
142131 Queue < DTEOperation . DTEPrepared > actual = target . getExecuted ( ) ;
143- Assert . IsTrue ( actual . Count != expected . Length ) ;
144- Assert . IsTrue ( actual . Count == 2 ) ;
132+ Assert . True ( actual . Count != expected . Length ) ;
133+ Assert . True ( actual . Count == 2 ) ;
145134
146135 int idx = 0 ;
147136 foreach ( DTEOperation . DTEPrepared obj in actual ) {
148- Assert . AreEqual ( expected [ idx ++ ] , obj ) ;
137+ Assert . Equal ( expected [ idx ++ ] , obj ) ;
149138 }
150139 }
151140
0 commit comments