Skip to content

Commit c46b81e

Browse files
committed
[UVHD Tenant Admin] Add admin cmdlet to delete and copy UVHD part 2
1 parent 83a1642 commit c46b81e

File tree

8 files changed

+199
-207
lines changed

8 files changed

+199
-207
lines changed

src/ServiceManagement/RemoteApp/Commands.RemoteApp.Test/Collection/RemoteAppCollection.cs

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
namespace Microsoft.WindowsAzure.Commands.RemoteApp.Test
1818
{
1919
using Common;
20-
using Microsoft.VisualStudio.TestTools.UnitTesting;
2120
using Microsoft.WindowsAzure.Management.RemoteApp;
2221
using Microsoft.WindowsAzure.Management.RemoteApp.Cmdlets;
2322
using Microsoft.WindowsAzure.Management.RemoteApp.Models;
@@ -30,14 +29,15 @@ namespace Microsoft.WindowsAzure.Commands.RemoteApp.Test
3029
using System.Management.Automation;
3130
using System.Threading;
3231
using System.Threading.Tasks;
32+
using Xunit;
3333

3434
// Get-AzureRemoteAppCollectionUsageDetails, Get-AzureRemoteAppCollectionUsageSummary,
35-
[TestClass]
35+
3636
public class RemoteAppCollectionTest : RemoteAppClientTest
3737
{
3838

39-
[TestMethod]
40-
[TestCategory("CheckIn")]
39+
[Fact]
40+
[Trait(Category.AcceptanceType, Category.CheckIn)]
4141
public void GetAllCollections()
4242
{
4343
int countOfExpectedCollections = 0;
@@ -52,32 +52,32 @@ public void GetAllCollections()
5252
mockCmdlet.ExecuteCmdlet();
5353
if (mockCmdlet.runTime().ErrorStream.Count != 0)
5454
{
55-
Assert.IsTrue(false,
55+
Assert.True(false,
5656
String.Format("Get-AzureRemoteAppCollection returned the following error {0}.",
5757
mockCmdlet.runTime().ErrorStream[0].Exception.Message
5858
)
5959
);
6060
}
6161

6262
List<Collection> collections = MockObject.ConvertList<Collection>(mockCmdlet.runTime().OutputPipeline);
63-
Assert.IsNotNull(collections);
63+
Assert.NotNull(collections);
6464

65-
Assert.IsTrue(collections.Count == countOfExpectedCollections,
65+
Assert.True(collections.Count == countOfExpectedCollections,
6666
String.Format("The expected number of collections returned {0} does not match the actual {1}.",
6767
countOfExpectedCollections,
6868
collections.Count
6969
)
7070
);
7171

72-
Assert.IsTrue(MockObject.HasExpectedResults<Collection>(collections, MockObject.ContainsExpectedCollection),
72+
Assert.True(MockObject.HasExpectedResults<Collection>(collections, MockObject.ContainsExpectedCollection),
7373
"The actual result does not match the expected."
7474
);
7575

7676
Log("The test for Get-AzureRemoteAppCollection with {0} collections completed successfully", countOfExpectedCollections);
7777
}
7878

79-
[TestMethod]
80-
[TestCategory("CheckIn")]
79+
[Fact]
80+
[Trait(Category.AcceptanceType, Category.CheckIn)]
8181
public void GetCollectionsByName()
8282
{
8383
int countOfExpectedCollections = 1;
@@ -96,30 +96,30 @@ public void GetCollectionsByName()
9696

9797
if (mockCmdlet.runTime().ErrorStream.Count != 0)
9898
{
99-
Assert.IsTrue(false,
99+
Assert.True(false,
100100
String.Format("Get-AzureRemoteAppUser returned the following error {0}.",
101101
mockCmdlet.runTime().ErrorStream[0].Exception.Message
102102
)
103103
);
104104
}
105105

106106
List<Collection> collections = MockObject.ConvertList<Collection>(mockCmdlet.runTime().OutputPipeline);
107-
Assert.IsNotNull(collections);
107+
Assert.NotNull(collections);
108108

109-
Assert.IsTrue(collections.Count == countOfExpectedCollections,
109+
Assert.True(collections.Count == countOfExpectedCollections,
110110
String.Format("The expected number of collections returned {0} does not match the actual {1}.",
111111
countOfExpectedCollections,
112112
collections.Count
113113
)
114114
);
115115

116-
Assert.IsTrue(MockObject.HasExpectedResults<Collection>(collections, MockObject.ContainsExpectedCollection),
116+
Assert.True(MockObject.HasExpectedResults<Collection>(collections, MockObject.ContainsExpectedCollection),
117117
"The actual result does not match the expected."
118118
);
119119
}
120120

121-
[TestMethod]
122-
[TestCategory("CheckIn")]
121+
[Fact]
122+
[Trait(Category.AcceptanceType, Category.CheckIn)]
123123
public void AddCollection()
124124
{
125125
List<TrackingResult> trackingIds = null;
@@ -141,30 +141,30 @@ public void AddCollection()
141141
mockCmdlet.ExecuteCmdlet();
142142
if (mockCmdlet.runTime().ErrorStream.Count != 0)
143143
{
144-
Assert.IsTrue(false,
144+
Assert.True(false,
145145
String.Format("New-AzureRemoteAppCollection returned the following error {0}",
146146
mockCmdlet.runTime().ErrorStream[0].Exception.Message
147147
)
148148
);
149149
}
150150

151151
trackingIds = MockObject.ConvertList<TrackingResult>(mockCmdlet.runTime().OutputPipeline);
152-
Assert.IsNotNull(trackingIds);
152+
Assert.NotNull(trackingIds);
153153

154-
Assert.IsTrue(trackingIds.Count == countOfExpectedCollections,
154+
Assert.True(trackingIds.Count == countOfExpectedCollections,
155155
String.Format("The expected number of collections returned {0} does not match the actual {1}",
156156
countOfExpectedCollections,
157157
trackingIds.Count
158158
)
159159
);
160160

161-
Assert.IsTrue(MockObject.HasExpectedResults<TrackingResult>(trackingIds, MockObject.ContainsExpectedTrackingId),
161+
Assert.True(MockObject.HasExpectedResults<TrackingResult>(trackingIds, MockObject.ContainsExpectedTrackingId),
162162
"The actual result does not match the expected."
163163
);
164164
}
165165

166-
[TestMethod]
167-
[TestCategory("CheckIn")]
166+
[Fact]
167+
[Trait(Category.AcceptanceType, Category.CheckIn)]
168168
public void UpdateCollection()
169169
{
170170
List<TrackingResult> trackingIds = null;
@@ -183,29 +183,29 @@ public void UpdateCollection()
183183
mockCmdlet.ExecuteCmdlet();
184184
if (mockCmdlet.runTime().ErrorStream.Count != 0)
185185
{
186-
Assert.IsTrue(false,
186+
Assert.True(false,
187187
String.Format("New-AzureRemoteAppCollection returned the following error {0}",
188188
mockCmdlet.runTime().ErrorStream[0].Exception.Message
189189
)
190190
);
191191
}
192192

193193
trackingIds = MockObject.ConvertList<TrackingResult>(mockCmdlet.runTime().OutputPipeline);
194-
Assert.IsNotNull(trackingIds);
194+
Assert.NotNull(trackingIds);
195195

196-
Assert.IsTrue(trackingIds.Count == countOfExpectedCollections,
196+
Assert.True(trackingIds.Count == countOfExpectedCollections,
197197
String.Format("The expected number of collections returned {0} does not match the actual {1}",
198198
countOfExpectedCollections,
199199
trackingIds.Count
200200
)
201201
);
202202

203-
Assert.IsTrue(MockObject.HasExpectedResults<TrackingResult>(trackingIds, MockObject.ContainsExpectedTrackingId),
203+
Assert.True(MockObject.HasExpectedResults<TrackingResult>(trackingIds, MockObject.ContainsExpectedTrackingId),
204204
"The actual result does not match the expected."
205205
);
206206
}
207207

208-
[TestMethod]
208+
[Fact]
209209
public void PatchCollectionTest()
210210
{
211211
UpdateAzureRemoteAppCollection mockCmdlet = SetUpTestCommon<UpdateAzureRemoteAppCollection>();
@@ -232,8 +232,8 @@ public void PatchCollectionTest()
232232
PerfomrCollectionTestHelper(mockCmdlet, collectionName, expectedCollection, expectedTrackingId, requestData, true);
233233
}
234234

235-
[TestMethod]
236-
[TestCategory("CheckIn")]
235+
[Fact]
236+
[Trait(Category.AcceptanceType, Category.CheckIn)]
237237
public void SetCollection()
238238
{
239239
SetAzureRemoteAppCollection mockCmdlet = SetUpTestCommon<SetAzureRemoteAppCollection>();
@@ -260,7 +260,7 @@ public void SetCollection()
260260
PerfomrCollectionTestHelper(mockCmdlet, collectionName, expectedCollection, expectedTrackingId, requestData, false);
261261
}
262262

263-
[TestMethod]
263+
[Fact]
264264
public void SetCollectionCustomRdpPropertyTest()
265265
{
266266
SetAzureRemoteAppCollection mockCmdlet = SetUpTestCommon<SetAzureRemoteAppCollection>();
@@ -286,7 +286,7 @@ public void SetCollectionCustomRdpPropertyTest()
286286
PerfomrCollectionTestHelper(mockCmdlet, collectionName, expectedCollection, expectedTrackingId, requestData, false);
287287
}
288288

289-
[TestMethod]
289+
[Fact]
290290
public void SetCollectionDescriptionTest()
291291
{
292292
SetAzureRemoteAppCollection mockCmdlet = SetUpTestCommon<SetAzureRemoteAppCollection>();
@@ -368,17 +368,17 @@ private void PerformCollectionTestWithAdInfoHelper(
368368
cmdRuntime = mockCmdlet.runTime();
369369
if (cmdRuntime.ErrorStream.Count > 0)
370370
{
371-
Assert.IsTrue(cmdRuntime.ErrorStream.Count == 0,
371+
Assert.True(cmdRuntime.ErrorStream.Count == 0,
372372
String.Format("Set-AzureRemoteAppCollection returned the following error {0}",
373373
mockCmdlet.runTime().ErrorStream[0].Exception.Message));
374374
}
375375

376376
trackingIds = LanguagePrimitives.GetEnumerable(mockCmdlet.runTime().OutputPipeline).Cast<TrackingResult>();
377-
Assert.IsNotNull(trackingIds);
377+
Assert.NotNull(trackingIds);
378378

379-
Assert.AreEqual(1, trackingIds.Count());
379+
Assert.Equal(1, trackingIds.Count());
380380

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.");
382382
}
383383

384384

@@ -430,20 +430,20 @@ private void PerfomrCollectionTestHelper(
430430
cmdRuntime = mockCmdlet.runTime();
431431
if (cmdRuntime.ErrorStream.Count > 0)
432432
{
433-
Assert.IsTrue(cmdRuntime.ErrorStream.Count == 0,
433+
Assert.True(cmdRuntime.ErrorStream.Count == 0,
434434
String.Format("Set-AzureRemoteAppCollection returned the following error {0}",
435435
mockCmdlet.runTime().ErrorStream[0].Exception.Message));
436436
}
437437

438438
trackingIds = LanguagePrimitives.GetEnumerable(mockCmdlet.runTime().OutputPipeline).Cast<TrackingResult>();
439-
Assert.IsNotNull(trackingIds);
439+
Assert.NotNull(trackingIds);
440440

441-
Assert.AreEqual(1, trackingIds.Count());
441+
Assert.Equal(1, trackingIds.Count());
442442

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.");
444444
}
445445

446-
[TestMethod]
446+
[Fact]
447447
public void SetCollectionAdConfigTest()
448448
{
449449
SetAzureRemoteAppCollection mockCmdlet = SetUpTestCommon<SetAzureRemoteAppCollection>();
@@ -477,7 +477,7 @@ public void SetCollectionAdConfigTest()
477477
PerformCollectionTestWithAdInfoHelper(mockCmdlet, collectionName, expectedCollection, expectedTrackingId, requestData, false);
478478
}
479479

480-
[TestMethod]
480+
[Fact]
481481
public void SetInactiveCollectionAdConfigTest()
482482
{
483483
SetAzureRemoteAppCollection mockCmdlet = SetUpTestCommon<SetAzureRemoteAppCollection>();
@@ -511,7 +511,7 @@ public void SetInactiveCollectionAdConfigTest()
511511
PerformCollectionTestWithAdInfoHelper(mockCmdlet, collectionName, expectedCollection, expectedTrackingId, requestData, true);
512512
}
513513

514-
[TestMethod]
514+
[Fact]
515515
public void RemoveCollection()
516516
{
517517
List<TrackingResult> trackingIds = null;
@@ -530,25 +530,25 @@ public void RemoveCollection()
530530
mockCmdlet.ExecuteCmdlet();
531531
if (mockCmdlet.runTime().ErrorStream.Count != 0)
532532
{
533-
Assert.IsTrue(false,
533+
Assert.True(false,
534534
String.Format("Remove-AzureRemoteAppCollection returned the following error {0}",
535535
mockCmdlet.runTime().ErrorStream[0].Exception.Message
536536
)
537537
);
538538
}
539539

540540
trackingIds = MockObject.ConvertList<TrackingResult>(mockCmdlet.runTime().OutputPipeline);
541-
Assert.IsNotNull(trackingIds);
541+
Assert.NotNull(trackingIds);
542542

543-
Assert.IsTrue(MockObject.HasExpectedResults<TrackingResult>(trackingIds, MockObject.ContainsExpectedTrackingId),
543+
Assert.True(MockObject.HasExpectedResults<TrackingResult>(trackingIds, MockObject.ContainsExpectedTrackingId),
544544
"The actual result does not match the expected."
545545
);
546546

547547
Log("The test for Remove-AzureRemoteAppCollection completed successfully");
548548
}
549549

550-
[TestMethod]
551-
[TestCategory("CheckIn")]
550+
[Fact]
551+
[Trait(Category.AcceptanceType, Category.CheckIn)]
552552
public void GetRegionList()
553553
{
554554
List<Region> regionList = null;
@@ -563,17 +563,17 @@ public void GetRegionList()
563563
mockCmdlet.ExecuteCmdlet();
564564
if (mockCmdlet.runTime().ErrorStream.Count != 0)
565565
{
566-
Assert.IsTrue(false,
566+
Assert.True(false,
567567
String.Format("Get-AzureRemoteAppRegionList returned the following error {0}.",
568568
mockCmdlet.runTime().ErrorStream[0].Exception.Message
569569
)
570570
);
571571
}
572572

573573
regionList = MockObject.ConvertList<Region>(mockCmdlet.runTime().OutputPipeline);
574-
Assert.IsNotNull(regionList);
574+
Assert.NotNull(regionList);
575575

576-
Assert.IsTrue(MockObject.HasExpectedResults<Region>(regionList, MockObject.ContainsExpectedRegion),
576+
Assert.True(MockObject.HasExpectedResults<Region>(regionList, MockObject.ContainsExpectedRegion),
577577
"The actual result does not match the expected."
578578
);
579579

src/ServiceManagement/RemoteApp/Commands.RemoteApp.Test/OperationResult/RemoteAppOperationResult.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,19 @@
1515
namespace Microsoft.WindowsAzure.Commands.RemoteApp.Test
1616
{
1717
using Common;
18-
using Microsoft.VisualStudio.TestTools.UnitTesting;
1918
using Microsoft.WindowsAzure.Management.RemoteApp.Cmdlets;
2019
using Microsoft.WindowsAzure.Management.RemoteApp.Models;
2120
using Microsoft.WindowsAzure.Commands.ScenarioTest;
2221
using System;
2322
using System.Collections.Generic;
2423
using System.Management.Automation;
24+
using Xunit;
2525

26-
[TestClass]
2726
public class RemoteAppOperationResult : RemoteAppClientTest
2827
{
2928

30-
[TestMethod]
31-
[TestCategory("CheckIn")]
29+
[Fact]
30+
[Trait(Category.AcceptanceType, Category.CheckIn)]
3231
public void GetResult()
3332
{
3433
List<OperationResult> operationResult = null;
@@ -48,24 +47,24 @@ public void GetResult()
4847
mockCmdlet.ExecuteCmdlet();
4948
if (mockCmdlet.runTime().ErrorStream.Count != 0)
5049
{
51-
Assert.IsTrue(false,
50+
Assert.True(false,
5251
String.Format("Get-AzureRemoteAppCollection returned the following error {0}.",
5352
mockCmdlet.runTime().ErrorStream[0].Exception.Message
5453
)
5554
);
5655
}
5756

5857
operationResult = MockObject.ConvertList<OperationResult>(mockCmdlet.runTime().OutputPipeline);
59-
Assert.IsNotNull(operationResult);
58+
Assert.NotNull(operationResult);
6059

61-
Assert.IsTrue(operationResult.Count == countOfExpectedResults,
60+
Assert.True(operationResult.Count == countOfExpectedResults,
6261
String.Format("The expected number of templates returned {0} does not match the actual {1}",
6362
countOfExpectedResults,
6463
operationResult.Count
6564
)
6665
);
6766

68-
Assert.IsTrue(MockObject.HasExpectedResults<OperationResult>(operationResult, MockObject.ContainsExpectedOperationResult),
67+
Assert.True(MockObject.HasExpectedResults<OperationResult>(operationResult, MockObject.ContainsExpectedOperationResult),
6968
"The actual result does not match the expected."
7069
);
7170

0 commit comments

Comments
 (0)