17
17
namespace Microsoft . WindowsAzure . Commands . RemoteApp . Test
18
18
{
19
19
using Common ;
20
- using Microsoft . VisualStudio . TestTools . UnitTesting ;
21
20
using Microsoft . WindowsAzure . Management . RemoteApp ;
22
21
using Microsoft . WindowsAzure . Management . RemoteApp . Cmdlets ;
23
22
using Microsoft . WindowsAzure . Management . RemoteApp . Models ;
@@ -30,14 +29,15 @@ namespace Microsoft.WindowsAzure.Commands.RemoteApp.Test
30
29
using System . Management . Automation ;
31
30
using System . Threading ;
32
31
using System . Threading . Tasks ;
32
+ using Xunit ;
33
33
34
34
// Get-AzureRemoteAppCollectionUsageDetails, Get-AzureRemoteAppCollectionUsageSummary,
35
- [ TestClass ]
35
+
36
36
public class RemoteAppCollectionTest : RemoteAppClientTest
37
37
{
38
38
39
- [ TestMethod ]
40
- [ TestCategory ( " CheckIn" ) ]
39
+ [ Fact ]
40
+ [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
41
41
public void GetAllCollections ( )
42
42
{
43
43
int countOfExpectedCollections = 0 ;
@@ -52,32 +52,32 @@ public void GetAllCollections()
52
52
mockCmdlet . ExecuteCmdlet ( ) ;
53
53
if ( mockCmdlet . runTime ( ) . ErrorStream . Count != 0 )
54
54
{
55
- Assert . IsTrue ( false ,
55
+ Assert . True ( false ,
56
56
String . Format ( "Get-AzureRemoteAppCollection returned the following error {0}." ,
57
57
mockCmdlet . runTime ( ) . ErrorStream [ 0 ] . Exception . Message
58
58
)
59
59
) ;
60
60
}
61
61
62
62
List < Collection > collections = MockObject . ConvertList < Collection > ( mockCmdlet . runTime ( ) . OutputPipeline ) ;
63
- Assert . IsNotNull ( collections ) ;
63
+ Assert . NotNull ( collections ) ;
64
64
65
- Assert . IsTrue ( collections . Count == countOfExpectedCollections ,
65
+ Assert . True ( collections . Count == countOfExpectedCollections ,
66
66
String . Format ( "The expected number of collections returned {0} does not match the actual {1}." ,
67
67
countOfExpectedCollections ,
68
68
collections . Count
69
69
)
70
70
) ;
71
71
72
- Assert . IsTrue ( MockObject . HasExpectedResults < Collection > ( collections , MockObject . ContainsExpectedCollection ) ,
72
+ Assert . True ( MockObject . HasExpectedResults < Collection > ( collections , MockObject . ContainsExpectedCollection ) ,
73
73
"The actual result does not match the expected."
74
74
) ;
75
75
76
76
Log ( "The test for Get-AzureRemoteAppCollection with {0} collections completed successfully" , countOfExpectedCollections ) ;
77
77
}
78
78
79
- [ TestMethod ]
80
- [ TestCategory ( " CheckIn" ) ]
79
+ [ Fact ]
80
+ [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
81
81
public void GetCollectionsByName ( )
82
82
{
83
83
int countOfExpectedCollections = 1 ;
@@ -96,30 +96,30 @@ public void GetCollectionsByName()
96
96
97
97
if ( mockCmdlet . runTime ( ) . ErrorStream . Count != 0 )
98
98
{
99
- Assert . IsTrue ( false ,
99
+ Assert . True ( false ,
100
100
String . Format ( "Get-AzureRemoteAppUser returned the following error {0}." ,
101
101
mockCmdlet . runTime ( ) . ErrorStream [ 0 ] . Exception . Message
102
102
)
103
103
) ;
104
104
}
105
105
106
106
List < Collection > collections = MockObject . ConvertList < Collection > ( mockCmdlet . runTime ( ) . OutputPipeline ) ;
107
- Assert . IsNotNull ( collections ) ;
107
+ Assert . NotNull ( collections ) ;
108
108
109
- Assert . IsTrue ( collections . Count == countOfExpectedCollections ,
109
+ Assert . True ( collections . Count == countOfExpectedCollections ,
110
110
String . Format ( "The expected number of collections returned {0} does not match the actual {1}." ,
111
111
countOfExpectedCollections ,
112
112
collections . Count
113
113
)
114
114
) ;
115
115
116
- Assert . IsTrue ( MockObject . HasExpectedResults < Collection > ( collections , MockObject . ContainsExpectedCollection ) ,
116
+ Assert . True ( MockObject . HasExpectedResults < Collection > ( collections , MockObject . ContainsExpectedCollection ) ,
117
117
"The actual result does not match the expected."
118
118
) ;
119
119
}
120
120
121
- [ TestMethod ]
122
- [ TestCategory ( " CheckIn" ) ]
121
+ [ Fact ]
122
+ [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
123
123
public void AddCollection ( )
124
124
{
125
125
List < TrackingResult > trackingIds = null ;
@@ -141,30 +141,30 @@ public void AddCollection()
141
141
mockCmdlet . ExecuteCmdlet ( ) ;
142
142
if ( mockCmdlet . runTime ( ) . ErrorStream . Count != 0 )
143
143
{
144
- Assert . IsTrue ( false ,
144
+ Assert . True ( false ,
145
145
String . Format ( "New-AzureRemoteAppCollection returned the following error {0}" ,
146
146
mockCmdlet . runTime ( ) . ErrorStream [ 0 ] . Exception . Message
147
147
)
148
148
) ;
149
149
}
150
150
151
151
trackingIds = MockObject . ConvertList < TrackingResult > ( mockCmdlet . runTime ( ) . OutputPipeline ) ;
152
- Assert . IsNotNull ( trackingIds ) ;
152
+ Assert . NotNull ( trackingIds ) ;
153
153
154
- Assert . IsTrue ( trackingIds . Count == countOfExpectedCollections ,
154
+ Assert . True ( trackingIds . Count == countOfExpectedCollections ,
155
155
String . Format ( "The expected number of collections returned {0} does not match the actual {1}" ,
156
156
countOfExpectedCollections ,
157
157
trackingIds . Count
158
158
)
159
159
) ;
160
160
161
- Assert . IsTrue ( MockObject . HasExpectedResults < TrackingResult > ( trackingIds , MockObject . ContainsExpectedTrackingId ) ,
161
+ Assert . True ( MockObject . HasExpectedResults < TrackingResult > ( trackingIds , MockObject . ContainsExpectedTrackingId ) ,
162
162
"The actual result does not match the expected."
163
163
) ;
164
164
}
165
165
166
- [ TestMethod ]
167
- [ TestCategory ( " CheckIn" ) ]
166
+ [ Fact ]
167
+ [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
168
168
public void UpdateCollection ( )
169
169
{
170
170
List < TrackingResult > trackingIds = null ;
@@ -183,29 +183,29 @@ public void UpdateCollection()
183
183
mockCmdlet . ExecuteCmdlet ( ) ;
184
184
if ( mockCmdlet . runTime ( ) . ErrorStream . Count != 0 )
185
185
{
186
- Assert . IsTrue ( false ,
186
+ Assert . True ( false ,
187
187
String . Format ( "New-AzureRemoteAppCollection returned the following error {0}" ,
188
188
mockCmdlet . runTime ( ) . ErrorStream [ 0 ] . Exception . Message
189
189
)
190
190
) ;
191
191
}
192
192
193
193
trackingIds = MockObject . ConvertList < TrackingResult > ( mockCmdlet . runTime ( ) . OutputPipeline ) ;
194
- Assert . IsNotNull ( trackingIds ) ;
194
+ Assert . NotNull ( trackingIds ) ;
195
195
196
- Assert . IsTrue ( trackingIds . Count == countOfExpectedCollections ,
196
+ Assert . True ( trackingIds . Count == countOfExpectedCollections ,
197
197
String . Format ( "The expected number of collections returned {0} does not match the actual {1}" ,
198
198
countOfExpectedCollections ,
199
199
trackingIds . Count
200
200
)
201
201
) ;
202
202
203
- Assert . IsTrue ( MockObject . HasExpectedResults < TrackingResult > ( trackingIds , MockObject . ContainsExpectedTrackingId ) ,
203
+ Assert . True ( MockObject . HasExpectedResults < TrackingResult > ( trackingIds , MockObject . ContainsExpectedTrackingId ) ,
204
204
"The actual result does not match the expected."
205
205
) ;
206
206
}
207
207
208
- [ TestMethod ]
208
+ [ Fact ]
209
209
public void PatchCollectionTest ( )
210
210
{
211
211
UpdateAzureRemoteAppCollection mockCmdlet = SetUpTestCommon < UpdateAzureRemoteAppCollection > ( ) ;
@@ -232,8 +232,8 @@ public void PatchCollectionTest()
232
232
PerfomrCollectionTestHelper ( mockCmdlet , collectionName , expectedCollection , expectedTrackingId , requestData , true ) ;
233
233
}
234
234
235
- [ TestMethod ]
236
- [ TestCategory ( " CheckIn" ) ]
235
+ [ Fact ]
236
+ [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
237
237
public void SetCollection ( )
238
238
{
239
239
SetAzureRemoteAppCollection mockCmdlet = SetUpTestCommon < SetAzureRemoteAppCollection > ( ) ;
@@ -260,7 +260,7 @@ public void SetCollection()
260
260
PerfomrCollectionTestHelper ( mockCmdlet , collectionName , expectedCollection , expectedTrackingId , requestData , false ) ;
261
261
}
262
262
263
- [ TestMethod ]
263
+ [ Fact ]
264
264
public void SetCollectionCustomRdpPropertyTest ( )
265
265
{
266
266
SetAzureRemoteAppCollection mockCmdlet = SetUpTestCommon < SetAzureRemoteAppCollection > ( ) ;
@@ -286,7 +286,7 @@ public void SetCollectionCustomRdpPropertyTest()
286
286
PerfomrCollectionTestHelper ( mockCmdlet , collectionName , expectedCollection , expectedTrackingId , requestData , false ) ;
287
287
}
288
288
289
- [ TestMethod ]
289
+ [ Fact ]
290
290
public void SetCollectionDescriptionTest ( )
291
291
{
292
292
SetAzureRemoteAppCollection mockCmdlet = SetUpTestCommon < SetAzureRemoteAppCollection > ( ) ;
@@ -368,17 +368,17 @@ private void PerformCollectionTestWithAdInfoHelper(
368
368
cmdRuntime = mockCmdlet . runTime ( ) ;
369
369
if ( cmdRuntime . ErrorStream . Count > 0 )
370
370
{
371
- Assert . IsTrue ( cmdRuntime . ErrorStream . Count == 0 ,
371
+ Assert . True ( cmdRuntime . ErrorStream . Count == 0 ,
372
372
String . Format ( "Set-AzureRemoteAppCollection returned the following error {0}" ,
373
373
mockCmdlet . runTime ( ) . ErrorStream [ 0 ] . Exception . Message ) ) ;
374
374
}
375
375
376
376
trackingIds = LanguagePrimitives . GetEnumerable ( mockCmdlet . runTime ( ) . OutputPipeline ) . Cast < TrackingResult > ( ) ;
377
- Assert . IsNotNull ( trackingIds ) ;
377
+ Assert . NotNull ( trackingIds ) ;
378
378
379
- Assert . AreEqual ( 1 , trackingIds . Count ( ) ) ;
379
+ Assert . Equal ( 1 , trackingIds . Count ( ) ) ;
380
380
381
- Assert . IsTrue ( trackingIds . Any ( t => t . TrackingId == trackingId ) , "The actual result does not match the expected." ) ;
381
+ Assert . True ( trackingIds . Any ( t => t . TrackingId == trackingId ) , "The actual result does not match the expected." ) ;
382
382
}
383
383
384
384
@@ -430,20 +430,20 @@ private void PerfomrCollectionTestHelper(
430
430
cmdRuntime = mockCmdlet . runTime ( ) ;
431
431
if ( cmdRuntime . ErrorStream . Count > 0 )
432
432
{
433
- Assert . IsTrue ( cmdRuntime . ErrorStream . Count == 0 ,
433
+ Assert . True ( cmdRuntime . ErrorStream . Count == 0 ,
434
434
String . Format ( "Set-AzureRemoteAppCollection returned the following error {0}" ,
435
435
mockCmdlet . runTime ( ) . ErrorStream [ 0 ] . Exception . Message ) ) ;
436
436
}
437
437
438
438
trackingIds = LanguagePrimitives . GetEnumerable ( mockCmdlet . runTime ( ) . OutputPipeline ) . Cast < TrackingResult > ( ) ;
439
- Assert . IsNotNull ( trackingIds ) ;
439
+ Assert . NotNull ( trackingIds ) ;
440
440
441
- Assert . AreEqual ( 1 , trackingIds . Count ( ) ) ;
441
+ Assert . Equal ( 1 , trackingIds . Count ( ) ) ;
442
442
443
- Assert . IsTrue ( trackingIds . Any ( t => t . TrackingId == trackingId ) , "The actual result does not match the expected." ) ;
443
+ Assert . True ( trackingIds . Any ( t => t . TrackingId == trackingId ) , "The actual result does not match the expected." ) ;
444
444
}
445
445
446
- [ TestMethod ]
446
+ [ Fact ]
447
447
public void SetCollectionAdConfigTest ( )
448
448
{
449
449
SetAzureRemoteAppCollection mockCmdlet = SetUpTestCommon < SetAzureRemoteAppCollection > ( ) ;
@@ -477,7 +477,7 @@ public void SetCollectionAdConfigTest()
477
477
PerformCollectionTestWithAdInfoHelper ( mockCmdlet , collectionName , expectedCollection , expectedTrackingId , requestData , false ) ;
478
478
}
479
479
480
- [ TestMethod ]
480
+ [ Fact ]
481
481
public void SetInactiveCollectionAdConfigTest ( )
482
482
{
483
483
SetAzureRemoteAppCollection mockCmdlet = SetUpTestCommon < SetAzureRemoteAppCollection > ( ) ;
@@ -511,7 +511,7 @@ public void SetInactiveCollectionAdConfigTest()
511
511
PerformCollectionTestWithAdInfoHelper ( mockCmdlet , collectionName , expectedCollection , expectedTrackingId , requestData , true ) ;
512
512
}
513
513
514
- [ TestMethod ]
514
+ [ Fact ]
515
515
public void RemoveCollection ( )
516
516
{
517
517
List < TrackingResult > trackingIds = null ;
@@ -530,25 +530,25 @@ public void RemoveCollection()
530
530
mockCmdlet . ExecuteCmdlet ( ) ;
531
531
if ( mockCmdlet . runTime ( ) . ErrorStream . Count != 0 )
532
532
{
533
- Assert . IsTrue ( false ,
533
+ Assert . True ( false ,
534
534
String . Format ( "Remove-AzureRemoteAppCollection returned the following error {0}" ,
535
535
mockCmdlet . runTime ( ) . ErrorStream [ 0 ] . Exception . Message
536
536
)
537
537
) ;
538
538
}
539
539
540
540
trackingIds = MockObject . ConvertList < TrackingResult > ( mockCmdlet . runTime ( ) . OutputPipeline ) ;
541
- Assert . IsNotNull ( trackingIds ) ;
541
+ Assert . NotNull ( trackingIds ) ;
542
542
543
- Assert . IsTrue ( MockObject . HasExpectedResults < TrackingResult > ( trackingIds , MockObject . ContainsExpectedTrackingId ) ,
543
+ Assert . True ( MockObject . HasExpectedResults < TrackingResult > ( trackingIds , MockObject . ContainsExpectedTrackingId ) ,
544
544
"The actual result does not match the expected."
545
545
) ;
546
546
547
547
Log ( "The test for Remove-AzureRemoteAppCollection completed successfully" ) ;
548
548
}
549
549
550
- [ TestMethod ]
551
- [ TestCategory ( " CheckIn" ) ]
550
+ [ Fact ]
551
+ [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
552
552
public void GetRegionList ( )
553
553
{
554
554
List < Region > regionList = null ;
@@ -563,17 +563,17 @@ public void GetRegionList()
563
563
mockCmdlet . ExecuteCmdlet ( ) ;
564
564
if ( mockCmdlet . runTime ( ) . ErrorStream . Count != 0 )
565
565
{
566
- Assert . IsTrue ( false ,
566
+ Assert . True ( false ,
567
567
String . Format ( "Get-AzureRemoteAppRegionList returned the following error {0}." ,
568
568
mockCmdlet . runTime ( ) . ErrorStream [ 0 ] . Exception . Message
569
569
)
570
570
) ;
571
571
}
572
572
573
573
regionList = MockObject . ConvertList < Region > ( mockCmdlet . runTime ( ) . OutputPipeline ) ;
574
- Assert . IsNotNull ( regionList ) ;
574
+ Assert . NotNull ( regionList ) ;
575
575
576
- Assert . IsTrue ( MockObject . HasExpectedResults < Region > ( regionList , MockObject . ContainsExpectedRegion ) ,
576
+ Assert . True ( MockObject . HasExpectedResults < Region > ( regionList , MockObject . ContainsExpectedRegion ) ,
577
577
"The actual result does not match the expected."
578
578
) ;
579
579
0 commit comments