Skip to content

Commit 59184cb

Browse files
committed
2 parents 13e76ae + bffc614 commit 59184cb

23 files changed

+98
-67
lines changed

src/Common/Commands.Common.Test/Mocks/MockCommandRuntime.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,18 @@ public void WriteError(ErrorRecord errorRecord)
102102

103103
public void WriteObject(object sendToPipeline, bool enumerateCollection)
104104
{
105-
OutputPipeline.Add(sendToPipeline);
105+
System.Collections.IEnumerable enumerable = LanguagePrimitives.GetEnumerable(sendToPipeline);
106+
if (enumerable != null && enumerateCollection)
107+
{
108+
foreach (object o in enumerable)
109+
{
110+
OutputPipeline.Add(o);
111+
}
112+
}
113+
else
114+
{
115+
OutputPipeline.Add(sendToPipeline);
116+
}
106117
}
107118

108119
public void WriteObject(object sendToPipeline)

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServices.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@
8383
<SpecificVersion>False</SpecificVersion>
8484
<HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
8585
</Reference>
86-
<Reference Include="Microsoft.WindowsAzure.Common.NetFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
87-
<SpecificVersion>False</SpecificVersion>
88-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll</HintPath>
89-
</Reference>
9086
<Reference Include="Microsoft.WindowsAzure.Management.SiteRecovery, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
9187
<SpecificVersion>False</SpecificVersion>
9288
<HintPath>..\..\..\packages\Microsoft.Azure.Management.RecoveryServices.0.5.1-preview\lib\net40\Microsoft.WindowsAzure.Management.SiteRecovery.dll</HintPath>

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/packages.config

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
1313
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.12.111071459" targetFramework="net45" />
1414
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
15-
<package id="Microsoft.WindowsAzure.Common" version="1.4.1" targetFramework="net45" />
16-
<package id="Microsoft.WindowsAzure.Common.Dependencies" version="1.1.1" targetFramework="net45" />
1715
<package id="Microsoft.WindowsAzure.Management" version="4.0.1" targetFramework="net45" />
1816
<package id="Microsoft.WindowsAzure.Management.Storage" version="5.0.0" targetFramework="net45" />
1917
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />

src/ServiceManagement/RemoteApp/Commands.RemoteApp.Tests/Commands.RemoteApp.Test.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@
8484
</Reference>
8585
<Reference Include="Microsoft.Azure.Common, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8686
<SpecificVersion>False</SpecificVersion>
87-
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll</HintPath>
87+
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.0.4\lib\net45\Microsoft.Azure.Common.dll</HintPath>
8888
</Reference>
8989
<Reference Include="Microsoft.Azure.Common.NetFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
9090
<SpecificVersion>False</SpecificVersion>
91-
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
91+
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.0.4\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
9292
</Reference>
9393
<Reference Include="Microsoft.Azure.Management.RemoteApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
9494
<SpecificVersion>False</SpecificVersion>
95-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.RemoteApp.1.0.7\lib\net40\Microsoft.Azure.Management.RemoteApp.dll</HintPath>
95+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.RemoteApp.1.0.8\lib\net40\Microsoft.Azure.Management.RemoteApp.dll</HintPath>
9696
</Reference>
9797
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
9898
<SpecificVersion>False</SpecificVersion>

src/ServiceManagement/RemoteApp/Commands.RemoteApp.Tests/Common/CollectionObjects.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public static int SetUpDefaultRemoteAppCollectionCreate(Mock<IRemoteAppManagemen
9696
CollectionCreationDetails collectionDetails = new CollectionCreationDetails()
9797
{
9898
Name = collectionName,
99-
BillingPlanName = billingPlan,
99+
PlanName = billingPlan,
100100
TemplateImageName = imageName,
101101
Mode = CollectionMode.Apps,
102102
Region = region,
@@ -110,7 +110,7 @@ public static int SetUpDefaultRemoteAppCollectionCreate(Mock<IRemoteAppManagemen
110110
{
111111
Name = collectionDetails.Name,
112112
Region = collectionDetails.Region,
113-
BillingPlanName = collectionDetails.BillingPlanName,
113+
PlanName = collectionDetails.PlanName,
114114
TemplateImageName = collectionDetails.TemplateImageName,
115115
Mode = collectionDetails.Mode,
116116
Description = collectionDetails.Description,
@@ -146,7 +146,7 @@ public static int SetUpDefaultRemoteAppCollectionSet(Mock<IRemoteAppManagementCl
146146
CollectionCreationDetails collectionDetails = new CollectionCreationDetails()
147147
{
148148
Name = collectionName,
149-
BillingPlanName = billingPlan,
149+
PlanName = billingPlan,
150150
TemplateImageName = imageName,
151151
Mode = CollectionMode.Apps,
152152
Description = "unit test"
@@ -167,7 +167,7 @@ public static int SetUpDefaultRemoteAppCollectionSet(Mock<IRemoteAppManagementCl
167167
new Collection()
168168
{
169169
Name = collectionDetails.Name,
170-
BillingPlanName = collectionDetails.BillingPlanName,
170+
PlanName = collectionDetails.PlanName,
171171
TemplateImageName = collectionDetails.TemplateImageName,
172172
Mode = collectionDetails.Mode,
173173
Description = collectionDetails.Description,

src/ServiceManagement/RemoteApp/Commands.RemoteApp.Tests/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
4-
<package id="Microsoft.Azure.Common" version="2.0.2" targetFramework="net45" />
4+
<package id="Microsoft.Azure.Common" version="2.0.4" targetFramework="net45" />
55
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
6-
<package id="Microsoft.Azure.Management.RemoteApp" version="1.0.7" targetFramework="net45" />
6+
<package id="Microsoft.Azure.Management.RemoteApp" version="1.0.8" targetFramework="net45" />
77
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net45" />
88
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
99
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net45" />

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Collection/Model/Collections.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class Collection : Microsoft.Azure.Management.RemoteApp.Models.Collection
2727
public Collection(Microsoft.Azure.Management.RemoteApp.Models.Collection col)
2828
{
2929
AdInfo = col.AdInfo;
30-
BillingPlanName = col.BillingPlanName;
30+
PlanName = col.PlanName;
3131
Type = col.Type;
3232
CustomRdpProperty = col.CustomRdpProperty;
3333
Description = col.Description;
@@ -46,7 +46,7 @@ public Collection(Microsoft.Azure.Management.RemoteApp.Models.Collection col)
4646
SubnetName = col.SubnetName;
4747
TemplateImageName = col.TemplateImageName;
4848
TrialOnly = col.TrialOnly;
49-
VnetName = String.IsNullOrWhiteSpace(col.VnetName) || col.VnetName.StartsWith ("simplevnet-") ? "" : col.VnetName;
49+
VNetName = String.IsNullOrWhiteSpace(col.VNetName) || col.VNetName.StartsWith ("simplevnet-") ? "" : col.VNetName;
5050
}
5151
}
5252
}

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Collection/NewAzureRemoteAppCollection.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public override void ExecuteCmdlet()
137137
Name = CollectionName,
138138
TemplateImageName = ImageName,
139139
Region = Location,
140-
BillingPlanName = Plan,
140+
PlanName = Plan,
141141
Description = Description,
142142
CustomRdpProperty = CustomRdpProperty,
143143
Mode = CollectionMode.Apps
@@ -150,7 +150,7 @@ public override void ExecuteCmdlet()
150150
case AzureVNet:
151151
{
152152
creds = Credential.GetNetworkCredential();
153-
details.VnetName = VNetName;
153+
details.VNetName = VNetName;
154154

155155
if (SubnetName != null)
156156
{
@@ -167,7 +167,7 @@ public override void ExecuteCmdlet()
167167
}
168168

169169
details.SubnetName = SubnetName;
170-
ValidateCustomerVNetParams(details.VnetName, details.SubnetName);
170+
ValidateCustomerVNetParams(details.VNetName, details.SubnetName);
171171

172172
if (DnsServers != null)
173173
{

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Collection/SetAzureRemoteAppCollection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public override void ExecuteCmdlet()
7676
details = new CollectionCreationDetails()
7777
{
7878
Name = CollectionName,
79-
BillingPlanName = String.IsNullOrWhiteSpace(Plan) ? collection.BillingPlanName : Plan,
79+
PlanName = String.IsNullOrWhiteSpace(Plan) ? collection.PlanName : Plan,
8080
Description = String.IsNullOrWhiteSpace(Description) ? collection.Description : Description,
8181
CustomRdpProperty = String.IsNullOrWhiteSpace(CustomRdpProperty) ? collection.CustomRdpProperty : CustomRdpProperty,
8282
TemplateImageName = collection.TemplateImageName
@@ -97,7 +97,7 @@ public override void ExecuteCmdlet()
9797
}
9898

9999
details.AdInfo = new ActiveDirectoryConfig();
100-
details.VnetName = collection.VnetName;
100+
details.VNetName = collection.VNetName;
101101
details.AdInfo.DomainName = collection.AdInfo.DomainName;
102102
details.AdInfo.OrganizationalUnit = collection.AdInfo.OrganizationalUnit;
103103

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Collection/UpdateAzureRemoteAppCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public override void ExecuteCmdlet()
5050
{
5151
Name = CollectionName,
5252
TemplateImageName = ImageName,
53-
BillingPlanName = collection.BillingPlanName
53+
PlanName = collection.PlanName
5454
};
5555

5656
if (ShouldProcess(CollectionName, "Update collection"))

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Commands.RemoteApp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
</Reference>
7272
<Reference Include="Microsoft.Azure.Management.RemoteApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7373
<SpecificVersion>False</SpecificVersion>
74-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.RemoteApp.1.0.7\lib\net40\Microsoft.Azure.Management.RemoteApp.dll</HintPath>
74+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.RemoteApp.1.0.8\lib\net40\Microsoft.Azure.Management.RemoteApp.dll</HintPath>
7575
</Reference>
7676
<Reference Include="Microsoft.Data.Edm, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7777
<HintPath>..\..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll</HintPath>

src/ServiceManagement/RemoteApp/Commands.RemoteApp/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<package id="Microsoft.Azure.Common" version="2.0.4" targetFramework="net45" />
55
<package id="Microsoft.Azure.Common.Authentication" version="1.0.15-preview" targetFramework="net45" />
66
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
7-
<package id="Microsoft.Azure.Management.RemoteApp" version="1.0.7" targetFramework="net45" />
7+
<package id="Microsoft.Azure.Management.RemoteApp" version="1.0.8" targetFramework="net45" />
88
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
99
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
1010
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />

src/ServiceManagement/Services/Commands.Test/CloudService/Development/GetAzureServiceProjectRuntimesTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ public void TestGetRuntimes()
5252

5353
cmdlet.GetAzureRuntimesProcess(string.Empty, manifest);
5454

55-
List<CloudRuntimePackage> actual = mockCommandRuntime.OutputPipeline[0] as List<CloudRuntimePackage>;
55+
IEnumerable<CloudRuntimePackage> actual = System.Management.Automation.LanguagePrimitives.GetEnumerable( mockCommandRuntime.OutputPipeline).Cast<CloudRuntimePackage>();
5656

57-
Assert.Equal<int>(runtimes.Count, actual.Count);
57+
Assert.Equal<int>(runtimes.Count, actual.Count());
5858
Assert.True(runtimes.All<CloudRuntimePackage>(p => actual.Any<CloudRuntimePackage>(p2 => p2.PackageUri.Equals(p.PackageUri))));
5959
}
6060
}

src/ServiceManagement/Services/Commands.Test/ExpressRoute/AzureDedicatedCircuitLinkTests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,10 @@ public void ListAzureDedicatedCircuitLinkSuccessful()
221221
cmdlet.ExecuteCmdlet();
222222

223223
// Assert
224-
IEnumerable<AzureDedicatedCircuitLink> actual =
225-
mockCommandRuntime.OutputPipeline[0] as IEnumerable<AzureDedicatedCircuitLink>;
226-
Assert.Equal(actual.ToArray().Count(), 2);
224+
IEnumerable<AzureDedicatedCircuitLink> actual =
225+
System.Management.Automation.LanguagePrimitives.GetEnumerable(mockCommandRuntime.OutputPipeline ).Cast<AzureDedicatedCircuitLink>();
226+
227+
Assert.Equal(actual.Count(), 2);
227228
}
228229
}
229230
}

src/ServiceManagement/Services/Commands.Test/ExpressRoute/AzureDedicatedCircuitServiceProviderTests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ public void ListAzureDedicatedCircuitServiceProviderSuccessful()
114114
cmdlet.ExecuteCmdlet();
115115

116116
// Assert
117-
IEnumerable<AzureDedicatedCircuitServiceProvider> actual =
118-
mockCommandRuntime.OutputPipeline[0] as IEnumerable<AzureDedicatedCircuitServiceProvider>;
119-
Assert.Equal(actual.ToArray().Count(), 2);
117+
IEnumerable<AzureDedicatedCircuitServiceProvider> actual =
118+
System.Management.Automation.LanguagePrimitives.GetEnumerable(mockCommandRuntime.OutputPipeline).Cast<AzureDedicatedCircuitServiceProvider>();
119+
120+
Assert.Equal(actual.Count(), 2);
120121
}
121122
}
122123
}

src/ServiceManagement/Services/Commands.Test/ExpressRoute/AzureDedicatedCircuitTests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
using Microsoft.WindowsAzure.Management.ExpressRoute.Models;
2828
using Moq;
2929
using Microsoft.Azure;
30+
using System.Management.Automation;
3031

3132
namespace Microsoft.WindowsAzure.Commands.Test.ExpressRoute
3233
{
@@ -251,9 +252,9 @@ public void ListAzureDedicatedCircuitSuccessful()
251252
cmdlet.ExecuteCmdlet();
252253

253254
// Assert
254-
IEnumerable<AzureDedicatedCircuit> actual =
255-
mockCommandRuntime.OutputPipeline[0] as IEnumerable<AzureDedicatedCircuit>;
256-
Assert.Equal(actual.ToArray().Count(), 2);
255+
IEnumerable<AzureDedicatedCircuit> actual = LanguagePrimitives.GetEnumerable(mockCommandRuntime.OutputPipeline).Cast<AzureDedicatedCircuit>();
256+
257+
Assert.Equal(actual.Count(), 2);
257258
}
258259
}
259260
}

src/ServiceManagement/Services/Commands.Test/MediaServices/GetAzureMediaServicesTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ public void ProcessGetMediaServicesTest()
7777
currentProfile.Subscriptions[new Guid(SubscriptionId)] = subscription;
7878

7979
getAzureMediaServiceCommand.ExecuteCmdlet();
80-
Assert.Equal(1, ((MockCommandRuntime)getAzureMediaServiceCommand.CommandRuntime).OutputPipeline.Count);
81-
IEnumerable<MediaServiceAccount> accounts = (IEnumerable<MediaServiceAccount>)((MockCommandRuntime)getAzureMediaServiceCommand.CommandRuntime).OutputPipeline.FirstOrDefault();
80+
81+
IEnumerable<MediaServiceAccount> accounts = System.Management.Automation.LanguagePrimitives.GetEnumerable(((MockCommandRuntime)getAzureMediaServiceCommand.CommandRuntime).OutputPipeline).Cast<MediaServiceAccount>();
82+
8283
Assert.NotNull(accounts);
84+
Assert.Equal(2, accounts.Count());
8385
Assert.True(accounts.Any(mediaservice => (mediaservice).AccountId == id1));
8486
Assert.True(accounts.Any(mediaservice => (mediaservice).AccountId == id2));
8587
Assert.True(accounts.Any(mediaservice => (mediaservice).Name.Equals("WAMS Account 1")));

src/ServiceManagement/Services/Commands.Test/ServiceBus/GetAzureSBLocationTest.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using System.Collections.Generic;
16+
using System.Linq;
1617
using Xunit;
1718
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
1819
using Microsoft.WindowsAzure.Commands.ServiceBus;
@@ -51,13 +52,15 @@ public void GetAzureSBLocationSuccessfull()
5152
cmdlet.ExecuteCmdlet();
5253

5354
// Assert
54-
List<ServiceBusLocation> actual = mockCommandRuntime.OutputPipeline[0] as List<ServiceBusLocation>;
55-
Assert.Equal<int>(expected.Count, actual.Count);
55+
IEnumerable<ServiceBusLocation> actual =
56+
System.Management.Automation.LanguagePrimitives.GetEnumerable(mockCommandRuntime.OutputPipeline).Cast<ServiceBusLocation>();
57+
58+
Assert.Equal<int>(expected.Count, actual.Count());
5659

5760
for (int i = 0; i < expected.Count; i++)
5861
{
59-
Assert.Equal<string>(expected[i].Code, actual[i].Code);
60-
Assert.Equal<string>(expected[i].FullName, actual[i].FullName);
62+
Assert.True(actual.Any((account) => account.Code == expected[i].Code));
63+
Assert.True(actual.Any((account) => account.FullName == expected[i].FullName));
6164
}
6265
}
6366
}

src/ServiceManagement/Services/Commands.Test/ServiceBus/GetAzureSBNamespaceTest.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
using System;
1616
using System.Collections.Generic;
17+
using System.Linq;
1718
using Xunit;
1819
using Microsoft.WindowsAzure.Commands.Common;
1920
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
@@ -78,11 +79,13 @@ public void ListNamespacesSuccessfull()
7879
cmdlet.ExecuteCmdlet();
7980

8081
// Assert
81-
List<ExtendedServiceBusNamespace> actual = mockCommandRuntime.OutputPipeline[0] as List<ExtendedServiceBusNamespace>;
82-
Assert.Equal<int>(expected.Count, actual.Count);
82+
IEnumerable<ExtendedServiceBusNamespace> actual = System.Management.Automation.LanguagePrimitives.GetEnumerable(mockCommandRuntime.OutputPipeline).Cast<ExtendedServiceBusNamespace>();
83+
84+
Assert.NotNull(actual);
85+
Assert.Equal<int>(expected.Count, actual.Count());
8386
for (int i = 0; i < expected.Count; i++)
8487
{
85-
Assert.Equal<string>(expected[i].Name, actual[i].Name);
88+
Assert.True(actual.Any((space) => space.Name == expected[i].Name));
8689
}
8790
}
8891

src/ServiceManagement/Services/Commands.Test/Websites/GetAzureWebSiteTests.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ public void ProcessGetWebsiteTest()
6060
};
6161

6262
getAzureWebsiteCommand.ExecuteWithProcessing();
63-
Assert.Equal(1, ((MockCommandRuntime)getAzureWebsiteCommand.CommandRuntime).OutputPipeline.Count);
64-
var sites = (IEnumerable<Site>)((MockCommandRuntime)getAzureWebsiteCommand.CommandRuntime).OutputPipeline.FirstOrDefault();
63+
64+
var sites = System.Management.Automation.LanguagePrimitives.GetEnumerable(((MockCommandRuntime)getAzureWebsiteCommand.CommandRuntime).OutputPipeline).Cast<Site>();
65+
6566
Assert.NotNull(sites);
67+
Assert.NotEmpty(sites);
6668
Assert.True(sites.Any(website => (website).Name.Equals("website1") && (website).WebSpace.Equals("webspace1")));
6769
Assert.True(sites.Any(website => (website).Name.Equals("website2") && (website).WebSpace.Equals("webspace2")));
6870
}
@@ -259,8 +261,12 @@ public void GetsSlots()
259261
};
260262

261263
getAzureWebsiteCommand.ExecuteWithProcessing();
262-
IEnumerable<Site> sites = ((MockCommandRuntime)getAzureWebsiteCommand.CommandRuntime).OutputPipeline[0] as IEnumerable<Site>;
263264

265+
IEnumerable<Site> sites = System.Management.Automation.LanguagePrimitives.GetEnumerable(((MockCommandRuntime)getAzureWebsiteCommand.CommandRuntime).OutputPipeline).Cast<Site>();
266+
267+
Assert.NotNull(sites);
268+
Assert.NotEmpty(sites);
269+
Assert.Equal(2, sites.Count());
264270
var website1 = sites.ElementAt(0);
265271
var website2 = sites.ElementAt(1);
266272
Assert.NotNull(website1);

0 commit comments

Comments
 (0)