Skip to content

Commit 98d8b70

Browse files
committed
Update tests and default value
1 parent cc66f5d commit 98d8b70

10 files changed

+4831
-3702
lines changed

src/Websites/Websites.Test/SessionRecords/Microsoft.Azure.Commands.Websites.Test.ScenarioTests.AccessRestrictionTests/TestAddWebAppAccessRestriction.json

Lines changed: 413 additions & 527 deletions
Large diffs are not rendered by default.

src/Websites/Websites.Test/SessionRecords/Microsoft.Azure.Commands.Websites.Test.ScenarioTests.AccessRestrictionTests/TestAddWebAppAccessRestrictionScm.json

Lines changed: 508 additions & 394 deletions
Large diffs are not rendered by default.

src/Websites/Websites.Test/SessionRecords/Microsoft.Azure.Commands.Websites.Test.ScenarioTests.AccessRestrictionTests/TestAddWebAppAccessRestrictionSlot.json

Lines changed: 1215 additions & 588 deletions
Large diffs are not rendered by default.

src/Websites/Websites.Test/SessionRecords/Microsoft.Azure.Commands.Websites.Test.ScenarioTests.AccessRestrictionTests/TestGetWebAppAccessRestriction.json

Lines changed: 340 additions & 397 deletions
Large diffs are not rendered by default.

src/Websites/Websites.Test/SessionRecords/Microsoft.Azure.Commands.Websites.Test.ScenarioTests.AccessRestrictionTests/TestRemoveWebAppAccessRestriction.json

Lines changed: 604 additions & 490 deletions
Large diffs are not rendered by default.

src/Websites/Websites.Test/SessionRecords/Microsoft.Azure.Commands.Websites.Test.ScenarioTests.AccessRestrictionTests/TestRemoveWebAppAccessRestrictionScm.json

Lines changed: 717 additions & 489 deletions
Large diffs are not rendered by default.

src/Websites/Websites.Test/SessionRecords/Microsoft.Azure.Commands.Websites.Test.ScenarioTests.AccessRestrictionTests/TestUpdateWebAppAccessRestrictionComplex.json

Lines changed: 667 additions & 439 deletions
Large diffs are not rendered by default.

src/Websites/Websites.Test/SessionRecords/Microsoft.Azure.Commands.Websites.Test.ScenarioTests.AccessRestrictionTests/TestUpdateWebAppAccessRestrictionSimple.json

Lines changed: 365 additions & 365 deletions
Large diffs are not rendered by default.

src/Websites/Websites/Cmdlets/AccessRestriction/AddAzureWebAppAccessRestrictionRule.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,7 @@
1717
using System.Management.Automation;
1818
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
1919
using Microsoft.Azure.Management.WebSites.Models;
20-
using System;
2120
using Microsoft.Azure.Commands.WebApps.Utilities;
22-
using System.Linq;
23-
using Microsoft.Azure.Commands.Common.Authentication;
24-
using Microsoft.Azure.Management.Internal.Network.Version2017_10_01;
25-
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
26-
using Microsoft.Azure.Management.Monitor.Version2018_09_01.Models;
27-
using System.ComponentModel;
2821

2922
namespace Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps
3023
{
@@ -76,8 +69,7 @@ public class AddAzureWebAppAccessRestrictionRuleCmdlet : WebAppBaseClientCmdLet
7669
[Parameter(ParameterSetName = SubnetIdParameterSet, Mandatory = false, HelpMessage = "Allow or Deny rule.")]
7770
[ValidateNotNullOrEmpty]
7871
[ValidateSet("Allow", "Deny")]
79-
[DefaultValue("Allow")]
80-
public string Action { get; set; }
72+
public string Action { get; set; } = "Allow";
8173

8274
[Parameter(ParameterSetName = IpAddressParameterSet, Mandatory = false, HelpMessage = "Deployment Slot name.")]
8375
[Parameter(ParameterSetName = SubnetNameParameterSet, Mandatory = false, HelpMessage = "Deployment Slot name.")]

src/Websites/Websites/Cmdlets/AccessRestriction/RemoveAzureWebAppAccessRestrictionRule.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
using System.Management.Automation;
1818
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
1919
using Microsoft.Azure.Management.WebSites.Models;
20-
using Microsoft.Azure.Management.Internal.Network.Version2017_10_01.Models;
2120
using Microsoft.Azure.Commands.WebApps.Utilities;
22-
using System.ComponentModel;
2321

2422
namespace Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps
2523
{
@@ -47,8 +45,7 @@ public class RemoveAzureWebAppAccessRestrictionRuleCmdlet : WebAppBaseClientCmdL
4745
[Parameter(Mandatory = false, HelpMessage = "Allow or Deny rule.")]
4846
[ValidateNotNullOrEmpty]
4947
[ValidateSet("Allow", "Deny")]
50-
[DefaultValue("Allow")]
51-
public string Action { get; set; }
48+
public string Action { get; set; } = "Allow";
5249

5350
[Parameter(Mandatory = false, HelpMessage = "Rule is aimed for Main site or Scm site.")]
5451
[ValidateNotNullOrEmpty]

0 commit comments

Comments
 (0)