Skip to content

Commit 44bfa1a

Browse files
committed
Revert test change and use IsParameterBound
1 parent ca00603 commit 44bfa1a

File tree

48 files changed

+501
-456
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+501
-456
lines changed

src/Compute/Compute.Test/ScenarioTests/VirtualMachineExtensionTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,23 +88,25 @@ public void TestAzureDiskEncryptionExtension()
8888
}
8989

9090
[Fact]
91-
[Trait(Category.RunType, Category.DesktopOnly)]
9291
[Trait(Category.AcceptanceType, Category.CheckIn)]
9392
public void TestAzureDiskEncryptionExtensionSinglePass()
9493
{
9594
TestRunner.RunTestScript("Test-AzureDiskEncryptionExtensionSinglePass");
9695
}
9796

97+
#if NETSTANDARD
9898
[Fact(Skip = "Updated Storage, needs re-recorded")]
9999
[Trait(Category.RunType, Category.DesktopOnly)]
100+
#else
101+
[Fact]
100102
[Trait(Category.AcceptanceType, Category.CheckIn)]
103+
#endif
101104
public void TestAzureDiskEncryptionExtensionSinglePassRemove()
102105
{
103106
TestRunner.RunTestScript("Test-AzureDiskEncryptionExtensionSinglePassRemove");
104107
}
105108

106109
[Fact]
107-
[Trait(Category.RunType, Category.DesktopOnly)]
108110
[Trait(Category.AcceptanceType, Category.CheckIn)]
109111
public void TestAzureDiskEncryptionExtensionSinglePassDisableAndRemove()
110112
{

src/Compute/Compute/AvailabilitySets/NewAzureAvailabilitySetCommand.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using AutoMapper;
15+
using System.Collections;
16+
using System.Linq;
17+
using System.Management.Automation;
1618
using Microsoft.Azure.Commands.Compute.Common;
1719
using Microsoft.Azure.Commands.Compute.Models;
1820
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
1921
using Microsoft.Azure.Management.Compute.Models;
20-
using System;
21-
using System.Collections;
22-
using System.Linq;
23-
using System.Management.Automation;
22+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
2423

2524
namespace Microsoft.Azure.Commands.Compute
2625
{
@@ -103,7 +102,7 @@ public override void ExecuteCmdlet()
103102
Tags = Tag == null ? null : Tag.Cast<DictionaryEntry>().ToDictionary(d => (string)d.Key, d => (string)d.Value)
104103
};
105104

106-
if (this.MyInvocation.BoundParameters.ContainsKey("Sku"))
105+
if (this.IsParameterBound(c => c.Sku))
107106
{
108107
avSetParams.Sku = new Sku();
109108
if (!string.IsNullOrEmpty(this.Sku))
@@ -112,7 +111,7 @@ public override void ExecuteCmdlet()
112111
}
113112
}
114113

115-
if (this.MyInvocation.BoundParameters.ContainsKey("ProximityPlacementGroupId"))
114+
if (this.IsParameterBound(c => c.ProximityPlacementGroupId))
116115
{
117116
avSetParams.ProximityPlacementGroup = new SubResource(this.ProximityPlacementGroupId);
118117
}

src/Compute/Compute/Generated/ContainerService/Config/AddAzureRmContainerServiceAgentPoolProfileCommand.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@
1919
// Changes to this file may cause incorrect behavior and will be lost if the
2020
// code is regenerated.
2121

22-
using Microsoft.Azure.Commands.Compute.Automation.Models;
23-
using Microsoft.Azure.Management.Compute.Models;
2422
using System;
2523
using System.Collections;
2624
using System.Collections.Generic;
2725
using System.Linq;
2826
using System.Management.Automation;
27+
using Microsoft.Azure.Commands.Compute.Automation.Models;
28+
using Microsoft.Azure.Management.Compute.Models;
29+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
2930

3031
namespace Microsoft.Azure.Commands.Compute.Automation
3132
{
@@ -82,10 +83,10 @@ private void Run()
8283

8384
var vAgentPoolProfiles = new ContainerServiceAgentPoolProfile();
8485

85-
vAgentPoolProfiles.Name = this.MyInvocation.BoundParameters.ContainsKey("Name") ? this.Name : null;
86+
vAgentPoolProfiles.Name = this.IsParameterBound(c => c.Name) ? this.Name : null;
8687
vAgentPoolProfiles.Count = this.Count;
87-
vAgentPoolProfiles.VmSize = this.MyInvocation.BoundParameters.ContainsKey("VmSize") ? this.VmSize : null;
88-
vAgentPoolProfiles.DnsPrefix = this.MyInvocation.BoundParameters.ContainsKey("DnsPrefix") ? this.DnsPrefix : null;
88+
vAgentPoolProfiles.VmSize = this.IsParameterBound(c => c.VmSize) ? this.VmSize : null;
89+
vAgentPoolProfiles.DnsPrefix = this.IsParameterBound(c => c.DnsPrefix) ? this.DnsPrefix : null;
8990
this.ContainerService.AgentPoolProfiles.Add(vAgentPoolProfiles);
9091
WriteObject(this.ContainerService);
9192
}

src/Compute/Compute/Generated/ContainerService/Config/NewAzureRmContainerServiceConfigCommand.cs

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@
1919
// Changes to this file may cause incorrect behavior and will be lost if the
2020
// code is regenerated.
2121

22-
using Microsoft.Azure.Commands.Compute.Automation.Models;
23-
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
24-
using Microsoft.Azure.Management.Compute.Models;
2522
using System;
2623
using System.Collections;
2724
using System.Collections.Generic;
2825
using System.Linq;
2926
using System.Management.Automation;
27+
using Microsoft.Azure.Commands.Compute.Automation.Models;
28+
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
29+
using Microsoft.Azure.Management.Compute.Models;
30+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
3031

3132
namespace Microsoft.Azure.Commands.Compute.Automation
3233
{
@@ -147,7 +148,7 @@ private void Run()
147148
// DiagnosticsProfile
148149
ContainerServiceDiagnosticsProfile vDiagnosticsProfile = null;
149150

150-
if (this.MyInvocation.BoundParameters.ContainsKey("OrchestratorType"))
151+
if (this.IsParameterBound(c => c.OrchestratorType))
151152
{
152153
if (vOrchestratorProfile == null)
153154
{
@@ -156,7 +157,7 @@ private void Run()
156157
vOrchestratorProfile.OrchestratorType = this.OrchestratorType.Value;
157158
}
158159

159-
if (this.MyInvocation.BoundParameters.ContainsKey("CustomProfileOrchestrator"))
160+
if (this.IsParameterBound(c => c.CustomProfileOrchestrator))
160161
{
161162
if (vCustomProfile == null)
162163
{
@@ -165,7 +166,7 @@ private void Run()
165166
vCustomProfile.Orchestrator = this.CustomProfileOrchestrator;
166167
}
167168

168-
if (this.MyInvocation.BoundParameters.ContainsKey("ServicePrincipalProfileClientId"))
169+
if (this.IsParameterBound(c => c.ServicePrincipalProfileClientId ))
169170
{
170171
if (vServicePrincipalProfile == null)
171172
{
@@ -174,7 +175,7 @@ private void Run()
174175
vServicePrincipalProfile.ClientId = this.ServicePrincipalProfileClientId;
175176
}
176177

177-
if (this.MyInvocation.BoundParameters.ContainsKey("ServicePrincipalProfileSecret"))
178+
if (this.IsParameterBound(c => c.ServicePrincipalProfileSecret))
178179
{
179180
if (vServicePrincipalProfile == null)
180181
{
@@ -183,7 +184,7 @@ private void Run()
183184
vServicePrincipalProfile.Secret = this.ServicePrincipalProfileSecret;
184185
}
185186

186-
if (this.MyInvocation.BoundParameters.ContainsKey("MasterCount"))
187+
if (this.IsParameterBound(c => c.MasterCount))
187188
{
188189
if (vMasterProfile == null)
189190
{
@@ -192,7 +193,7 @@ private void Run()
192193
vMasterProfile.Count = this.MasterCount;
193194
}
194195

195-
if (this.MyInvocation.BoundParameters.ContainsKey("MasterDnsPrefix"))
196+
if (this.IsParameterBound(c => c.MasterDnsPrefix))
196197
{
197198
if (vMasterProfile == null)
198199
{
@@ -201,7 +202,7 @@ private void Run()
201202
vMasterProfile.DnsPrefix = this.MasterDnsPrefix;
202203
}
203204

204-
if (this.MyInvocation.BoundParameters.ContainsKey("WindowsProfileAdminUsername"))
205+
if (this.IsParameterBound(c => c.WindowsProfileAdminUsername))
205206
{
206207
if (vWindowsProfile == null)
207208
{
@@ -210,7 +211,7 @@ private void Run()
210211
vWindowsProfile.AdminUsername = this.WindowsProfileAdminUsername;
211212
}
212213

213-
if (this.MyInvocation.BoundParameters.ContainsKey("WindowsProfileAdminPassword"))
214+
if (this.IsParameterBound(c => c.WindowsProfileAdminPassword))
214215
{
215216
if (vWindowsProfile == null)
216217
{
@@ -219,7 +220,7 @@ private void Run()
219220
vWindowsProfile.AdminPassword = this.WindowsProfileAdminPassword;
220221
}
221222

222-
if (this.MyInvocation.BoundParameters.ContainsKey("AdminUsername"))
223+
if (this.IsParameterBound(c => c.AdminUsername))
223224
{
224225
if (vLinuxProfile == null)
225226
{
@@ -229,7 +230,7 @@ private void Run()
229230
}
230231

231232

232-
if (this.MyInvocation.BoundParameters.ContainsKey("SshPublicKey"))
233+
if (this.IsParameterBound(c => c.SshPublicKey))
233234
{
234235
if (vLinuxProfile == null)
235236
{
@@ -264,9 +265,9 @@ private void Run()
264265

265266
var vContainerService = new PSContainerService
266267
{
267-
Location = this.MyInvocation.BoundParameters.ContainsKey("Location") ? this.Location : null,
268-
Tags = this.MyInvocation.BoundParameters.ContainsKey("Tag") ? this.Tag.Cast<DictionaryEntry>().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value) : null,
269-
AgentPoolProfiles = this.MyInvocation.BoundParameters.ContainsKey("AgentPoolProfile") ? this.AgentPoolProfile : null,
268+
Location = this.IsParameterBound(c => c.Location) ? this.Location : null,
269+
Tags = this.IsParameterBound(c => c.Tag) ? this.Tag.Cast<DictionaryEntry>().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value) : null,
270+
AgentPoolProfiles = this.IsParameterBound(c => c.AgentPoolProfile) ? this.AgentPoolProfile : null,
270271
OrchestratorProfile = vOrchestratorProfile,
271272
CustomProfile = vCustomProfile,
272273
ServicePrincipalProfile = vServicePrincipalProfile,

src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskConfigCommand.cs

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@
1919
// Changes to this file may cause incorrect behavior and will be lost if the
2020
// code is regenerated.
2121

22-
using Microsoft.Azure.Commands.Compute.Automation.Models;
23-
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
24-
using Microsoft.Azure.Management.Compute.Models;
2522
using System;
2623
using System.Collections;
2724
using System.Collections.Generic;
2825
using System.Linq;
2926
using System.Management.Automation;
27+
using Microsoft.Azure.Commands.Compute.Automation.Models;
28+
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
29+
using Microsoft.Azure.Management.Compute.Models;
30+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
3031

3132
namespace Microsoft.Azure.Commands.Compute.Automation
3233
{
@@ -146,7 +147,7 @@ private void Run()
146147
// EncryptionSettingsCollection
147148
EncryptionSettingsCollection vEncryptionSettingsCollection = null;
148149

149-
if (this.MyInvocation.BoundParameters.ContainsKey("SkuName"))
150+
if (this.IsParameterBound(c => c.SkuName))
150151
{
151152
if (vSku == null)
152153
{
@@ -155,7 +156,7 @@ private void Run()
155156
vSku.Name = this.SkuName;
156157
}
157158

158-
if (this.MyInvocation.BoundParameters.ContainsKey("CreateOption"))
159+
if (this.IsParameterBound(c => c.CreateOption))
159160
{
160161
if (vCreationData == null)
161162
{
@@ -164,7 +165,7 @@ private void Run()
164165
vCreationData.CreateOption = this.CreateOption;
165166
}
166167

167-
if (this.MyInvocation.BoundParameters.ContainsKey("StorageAccountId"))
168+
if (this.IsParameterBound(c => c.StorageAccountId))
168169
{
169170
if (vCreationData == null)
170171
{
@@ -173,7 +174,7 @@ private void Run()
173174
vCreationData.StorageAccountId = this.StorageAccountId;
174175
}
175176

176-
if (this.MyInvocation.BoundParameters.ContainsKey("ImageReference"))
177+
if (this.IsParameterBound(c => c.ImageReference))
177178
{
178179
if (vCreationData == null)
179180
{
@@ -182,7 +183,7 @@ private void Run()
182183
vCreationData.ImageReference = this.ImageReference;
183184
}
184185

185-
if (this.MyInvocation.BoundParameters.ContainsKey("SourceUri"))
186+
if (this.IsParameterBound(c => c.SourceUri))
186187
{
187188
if (vCreationData == null)
188189
{
@@ -191,7 +192,7 @@ private void Run()
191192
vCreationData.SourceUri = this.SourceUri;
192193
}
193194

194-
if (this.MyInvocation.BoundParameters.ContainsKey("SourceResourceId"))
195+
if (this.IsParameterBound(c => c.SourceResourceId))
195196
{
196197
if (vCreationData == null)
197198
{
@@ -200,7 +201,7 @@ private void Run()
200201
vCreationData.SourceResourceId = this.SourceResourceId;
201202
}
202203

203-
if (this.MyInvocation.BoundParameters.ContainsKey("EncryptionSettingsEnabled"))
204+
if (this.IsParameterBound(c => c.EncryptionSettingsEnabled))
204205
{
205206
if (vEncryptionSettingsCollection == null)
206207
{
@@ -209,7 +210,7 @@ private void Run()
209210
vEncryptionSettingsCollection.Enabled = (bool) this.EncryptionSettingsEnabled;
210211
}
211212

212-
if (this.MyInvocation.BoundParameters.ContainsKey("DiskEncryptionKey"))
213+
if (this.IsParameterBound(c => c.DiskEncryptionKey))
213214
{
214215
if (vEncryptionSettingsCollection == null)
215216
{
@@ -229,7 +230,7 @@ private void Run()
229230
vEncryptionSettingsCollection.EncryptionSettings[0].DiskEncryptionKey = this.DiskEncryptionKey;
230231
}
231232

232-
if (this.MyInvocation.BoundParameters.ContainsKey("KeyEncryptionKey"))
233+
if (this.IsParameterBound(c => c.KeyEncryptionKey))
233234
{
234235
if (vEncryptionSettingsCollection == null)
235236
{
@@ -251,14 +252,14 @@ private void Run()
251252

252253
var vDisk = new PSDisk
253254
{
254-
Zones = this.MyInvocation.BoundParameters.ContainsKey("Zone") ? this.Zone : null,
255-
OsType = this.MyInvocation.BoundParameters.ContainsKey("OsType") ? this.OsType : (OperatingSystemTypes?)null,
256-
HyperVGeneration = this.MyInvocation.BoundParameters.ContainsKey("HyperVGeneration") ? this.HyperVGeneration : null,
257-
DiskSizeGB = this.MyInvocation.BoundParameters.ContainsKey("DiskSizeGB") ? this.DiskSizeGB : (int?)null,
258-
DiskIOPSReadWrite = this.MyInvocation.BoundParameters.ContainsKey("DiskIOPSReadWrite") ? this.DiskIOPSReadWrite : (int?)null,
259-
DiskMBpsReadWrite = this.MyInvocation.BoundParameters.ContainsKey("DiskMBpsReadWrite") ? this.DiskMBpsReadWrite : (int?)null,
260-
Location = this.MyInvocation.BoundParameters.ContainsKey("Location") ? this.Location : null,
261-
Tags = this.MyInvocation.BoundParameters.ContainsKey("Tag") ? this.Tag.Cast<DictionaryEntry>().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value) : null,
255+
Zones = this.IsParameterBound(c => c.Zone) ? this.Zone : null,
256+
OsType = this.IsParameterBound(c => c.OsType) ? this.OsType : (OperatingSystemTypes?)null,
257+
HyperVGeneration = this.IsParameterBound(c => c.HyperVGeneration) ? this.HyperVGeneration : null,
258+
DiskSizeGB = this.IsParameterBound(c => c.DiskSizeGB) ? this.DiskSizeGB : (int?)null,
259+
DiskIOPSReadWrite = this.IsParameterBound(c => c.DiskIOPSReadWrite) ? this.DiskIOPSReadWrite : (int?)null,
260+
DiskMBpsReadWrite = this.IsParameterBound(c => c.DiskMBpsReadWrite) ? this.DiskMBpsReadWrite : (int?)null,
261+
Location = this.IsParameterBound(c => c.Location) ? this.Location : null,
262+
Tags = this.IsParameterBound(c => c.Tag) ? this.Tag.Cast<DictionaryEntry>().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value) : null,
262263
Sku = vSku,
263264
CreationData = vCreationData,
264265
EncryptionSettingsCollection = vEncryptionSettingsCollection,

0 commit comments

Comments
 (0)