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