@@ -21,14 +21,13 @@ namespace Microsoft.Azure.Commands.Test.RemoteApp
21
21
using System ;
22
22
using System . Collections . Generic ;
23
23
using System . Management . Automation ;
24
- using VisualStudio . TestTools . UnitTesting ;
24
+ using Xunit ;
25
25
26
26
// Get-AzureRemoteAppCollectionUsageDetails, Get-AzureRemoteAppCollectionUsageSummary,
27
- [ TestClass ]
28
27
public class RemoteAppCollectionTest : RemoteAppClientTest
29
28
{
30
29
31
- [ TestMethod ]
30
+ [ Fact ]
32
31
public void GetAllCollections ( )
33
32
{
34
33
int countOfExpectedCollections = 0 ;
@@ -43,31 +42,31 @@ public void GetAllCollections()
43
42
mockCmdlet . ExecuteCmdlet ( ) ;
44
43
if ( mockCmdlet . runTime ( ) . ErrorStream . Count != 0 )
45
44
{
46
- Assert . Fail (
45
+ Assert . True ( false ,
47
46
String . Format ( "Get-AzureRemoteAppCollection returned the following error {0}." ,
48
47
mockCmdlet . runTime ( ) . ErrorStream [ 0 ] . Exception . Message
49
48
)
50
49
) ;
51
50
}
52
51
53
52
List < Collection > collections = MockObject . ConvertList < Collection > ( mockCmdlet . runTime ( ) . OutputPipeline ) ;
54
- Assert . IsNotNull ( collections ) ;
53
+ Assert . NotNull ( collections ) ;
55
54
56
- Assert . IsTrue ( collections . Count == countOfExpectedCollections ,
55
+ Assert . True ( collections . Count == countOfExpectedCollections ,
57
56
String . Format ( "The expected number of collections returned {0} does not match the actual {1}." ,
58
57
countOfExpectedCollections ,
59
58
collections . Count
60
59
)
61
60
) ;
62
61
63
- Assert . IsTrue ( MockObject . HasExpectedResults < Collection > ( collections , MockObject . ContainsExpectedCollection ) ,
62
+ Assert . True ( MockObject . HasExpectedResults < Collection > ( collections , MockObject . ContainsExpectedCollection ) ,
64
63
"The actual result does not match the expected."
65
64
) ;
66
65
67
66
Log ( "The test for Get-AzureRemoteAppCollection with {0} collections completed successfully" , countOfExpectedCollections ) ;
68
67
}
69
68
70
- [ TestMethod ]
69
+ [ Fact ]
71
70
public void GetCollectionsByName ( )
72
71
{
73
72
int countOfExpectedCollections = 1 ;
@@ -86,32 +85,31 @@ public void GetCollectionsByName()
86
85
87
86
if ( mockCmdlet . runTime ( ) . ErrorStream . Count != 0 )
88
87
{
89
- Assert . Fail (
88
+ Assert . True ( false ,
90
89
String . Format ( "Get-AzureRemoteAppUser returned the following error {0}." ,
91
90
mockCmdlet . runTime ( ) . ErrorStream [ 0 ] . Exception . Message
92
91
)
93
92
) ;
94
93
}
95
94
96
95
List < Collection > collections = MockObject . ConvertList < Collection > ( mockCmdlet . runTime ( ) . OutputPipeline ) ;
97
- Assert . IsNotNull ( collections ) ;
96
+ Assert . NotNull ( collections ) ;
98
97
99
- Assert . IsTrue ( collections . Count == countOfExpectedCollections ,
98
+ Assert . True ( collections . Count == countOfExpectedCollections ,
100
99
String . Format ( "The expected number of collections returned {0} does not match the actual {1}." ,
101
100
countOfExpectedCollections ,
102
101
collections . Count
103
102
)
104
103
) ;
105
104
106
- Assert . IsTrue ( MockObject . HasExpectedResults < Collection > ( collections , MockObject . ContainsExpectedCollection ) ,
105
+ Assert . True ( MockObject . HasExpectedResults < Collection > ( collections , MockObject . ContainsExpectedCollection ) ,
107
106
"The actual result does not match the expected."
108
107
) ;
109
108
110
109
Log ( "The test for Get-AzureRemoteAppCollection with {0} collections completed successfully" , countOfExpectedCollections ) ;
111
110
}
112
111
113
- [ TestMethod ]
114
- [ Ignore ]
112
+ [ Fact ]
115
113
public void AddCollection ( )
116
114
{
117
115
List < TrackingResult > trackingIds = null ;
@@ -133,31 +131,31 @@ public void AddCollection()
133
131
mockCmdlet . ExecuteCmdlet ( ) ;
134
132
if ( mockCmdlet . runTime ( ) . ErrorStream . Count != 0 )
135
133
{
136
- Assert . Fail (
134
+ Assert . True ( false ,
137
135
String . Format ( "New-AzureRemoteAppCollection returned the following error {0}" ,
138
136
mockCmdlet . runTime ( ) . ErrorStream [ 0 ] . Exception . Message
139
137
)
140
138
) ;
141
139
}
142
140
143
141
trackingIds = MockObject . ConvertList < TrackingResult > ( mockCmdlet . runTime ( ) . OutputPipeline ) ;
144
- Assert . IsNotNull ( trackingIds ) ;
142
+ Assert . NotNull ( trackingIds ) ;
145
143
146
- Assert . IsTrue ( trackingIds . Count == countOfExpectedCollections ,
144
+ Assert . True ( trackingIds . Count == countOfExpectedCollections ,
147
145
String . Format ( "The expected number of collections returned {0} does not match the actual {1}" ,
148
146
countOfExpectedCollections ,
149
147
trackingIds . Count
150
148
)
151
149
) ;
152
150
153
- Assert . IsTrue ( MockObject . HasExpectedResults < TrackingResult > ( trackingIds , MockObject . ContainsExpectedTrackingId ) ,
151
+ Assert . True ( MockObject . HasExpectedResults < TrackingResult > ( trackingIds , MockObject . ContainsExpectedTrackingId ) ,
154
152
"The actual result does not match the expected."
155
153
) ;
156
154
157
155
Log ( "The test for New-AzureRemoteAppCollection completed successfully" ) ;
158
156
}
159
157
160
- [ TestMethod ]
158
+ [ Fact ]
161
159
public void UpdateCollection ( )
162
160
{
163
161
List < TrackingResult > trackingIds = null ;
@@ -176,31 +174,31 @@ public void UpdateCollection()
176
174
mockCmdlet . ExecuteCmdlet ( ) ;
177
175
if ( mockCmdlet . runTime ( ) . ErrorStream . Count != 0 )
178
176
{
179
- Assert . Fail (
177
+ Assert . True ( false ,
180
178
String . Format ( "New-AzureRemoteAppCollection returned the following error {0}" ,
181
179
mockCmdlet . runTime ( ) . ErrorStream [ 0 ] . Exception . Message
182
180
)
183
181
) ;
184
182
}
185
183
186
184
trackingIds = MockObject . ConvertList < TrackingResult > ( mockCmdlet . runTime ( ) . OutputPipeline ) ;
187
- Assert . IsNotNull ( trackingIds ) ;
185
+ Assert . NotNull ( trackingIds ) ;
188
186
189
- Assert . IsTrue ( trackingIds . Count == countOfExpectedCollections ,
187
+ Assert . True ( trackingIds . Count == countOfExpectedCollections ,
190
188
String . Format ( "The expected number of collections returned {0} does not match the actual {1}" ,
191
189
countOfExpectedCollections ,
192
190
trackingIds . Count
193
191
)
194
192
) ;
195
193
196
- Assert . IsTrue ( MockObject . HasExpectedResults < TrackingResult > ( trackingIds , MockObject . ContainsExpectedTrackingId ) ,
194
+ Assert . True ( MockObject . HasExpectedResults < TrackingResult > ( trackingIds , MockObject . ContainsExpectedTrackingId ) ,
197
195
"The actual result does not match the expected."
198
196
) ;
199
197
200
198
Log ( "The test for Update-AzureRemoteAppCollection completed successfully" ) ;
201
199
}
202
200
203
- [ TestMethod ]
201
+ [ Fact ]
204
202
public void SetCollection ( )
205
203
{
206
204
List < TrackingResult > trackingIds = null ;
@@ -223,31 +221,31 @@ public void SetCollection()
223
221
mockCmdlet . ExecuteCmdlet ( ) ;
224
222
if ( mockCmdlet . runTime ( ) . ErrorStream . Count != 0 )
225
223
{
226
- Assert . Fail (
224
+ Assert . True ( false ,
227
225
String . Format ( "New-AzureRemoteAppCollection returned the following error {0}" ,
228
226
mockCmdlet . runTime ( ) . ErrorStream [ 0 ] . Exception . Message
229
227
)
230
228
) ;
231
229
}
232
230
233
231
trackingIds = MockObject . ConvertList < TrackingResult > ( mockCmdlet . runTime ( ) . OutputPipeline ) ;
234
- Assert . IsNotNull ( trackingIds ) ;
232
+ Assert . NotNull ( trackingIds ) ;
235
233
236
- Assert . IsTrue ( trackingIds . Count == countOfExpectedCollections ,
234
+ Assert . True ( trackingIds . Count == countOfExpectedCollections ,
237
235
String . Format ( "The expected number of collections returned {0} does not match the actual {1}" ,
238
236
countOfExpectedCollections ,
239
237
trackingIds . Count
240
238
)
241
239
) ;
242
240
243
- Assert . IsTrue ( MockObject . HasExpectedResults < TrackingResult > ( trackingIds , MockObject . ContainsExpectedTrackingId ) ,
241
+ Assert . True ( MockObject . HasExpectedResults < TrackingResult > ( trackingIds , MockObject . ContainsExpectedTrackingId ) ,
244
242
"The actual result does not match the expected."
245
243
) ;
246
244
247
245
Log ( "The test for New-AzureRemoteAppCollection completed successfully" ) ;
248
246
}
249
247
250
- [ TestMethod ]
248
+ [ Fact ]
251
249
public void RemoveCollection ( )
252
250
{
253
251
List < TrackingResult > trackingIds = null ;
@@ -266,25 +264,24 @@ public void RemoveCollection()
266
264
mockCmdlet . ExecuteCmdlet ( ) ;
267
265
if ( mockCmdlet . runTime ( ) . ErrorStream . Count != 0 )
268
266
{
269
- Assert . Fail (
267
+ Assert . True ( false ,
270
268
String . Format ( "Remove-AzureRemoteAppCollection returned the following error {0}" ,
271
269
mockCmdlet . runTime ( ) . ErrorStream [ 0 ] . Exception . Message
272
270
)
273
271
) ;
274
272
}
275
273
276
274
trackingIds = MockObject . ConvertList < TrackingResult > ( mockCmdlet . runTime ( ) . OutputPipeline ) ;
277
- Assert . IsNotNull ( trackingIds ) ;
275
+ Assert . NotNull ( trackingIds ) ;
278
276
279
- Assert . IsTrue ( MockObject . HasExpectedResults < TrackingResult > ( trackingIds , MockObject . ContainsExpectedTrackingId ) ,
277
+ Assert . True ( MockObject . HasExpectedResults < TrackingResult > ( trackingIds , MockObject . ContainsExpectedTrackingId ) ,
280
278
"The actual result does not match the expected."
281
279
) ;
282
280
283
281
Log ( "The test for Remove-AzureRemoteAppCollection completed successfully" ) ;
284
282
}
285
283
286
- [ TestMethod ]
287
- [ Ignore ]
284
+ [ Fact ]
288
285
public void GetRegionList ( )
289
286
{
290
287
List < Region > regionList = null ;
@@ -300,17 +297,17 @@ public void GetRegionList()
300
297
mockCmdlet . ExecuteCmdlet ( ) ;
301
298
if ( mockCmdlet . runTime ( ) . ErrorStream . Count != 0 )
302
299
{
303
- Assert . Fail (
300
+ Assert . True ( false ,
304
301
String . Format ( "Get-AzureRemoteAppRegionList returned the following error {0}." ,
305
302
mockCmdlet . runTime ( ) . ErrorStream [ 0 ] . Exception . Message
306
303
)
307
304
) ;
308
305
}
309
306
310
- Assert . IsNotNull ( regionList ) ;
311
307
regionList = MockObject . ConvertList < Region > ( mockCmdlet . runTime ( ) . OutputPipeline ) ;
308
+ Assert . NotNull ( regionList ) ;
312
309
313
- Assert . IsTrue ( MockObject . HasExpectedResults < string > ( regions , MockObject . ContainsExpectedRegion ) , // This is expecting a List<string> instead of LocalModels.RegionList
310
+ Assert . True ( MockObject . HasExpectedResults < string > ( regions , MockObject . ContainsExpectedRegion ) , // This is expecting a List<string> instead of LocalModels.RegionList
314
311
"The actual result does not match the expected."
315
312
) ;
316
313
0 commit comments