public NewAutoscaleRuleCommandTests() { commandRuntimeMock = new Mock <ICommandRuntime>(); Cmdlet = new NewAutoscaleRuleCommand() { CommandRuntime = commandRuntimeMock.Object }; }
private ScaleRule CreateAutoscaleRule(string metricName = null) { var autocaseRuleCmd = new NewAutoscaleRuleCommand { MetricName = metricName ?? "Requests", MetricResourceId = "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/misitiooeltuyo", Operator = ComparisonOperationType.GreaterThan, MetricStatistic = MetricStatisticType.Average, Threshold = 10, TimeGrain = TimeSpan.FromMinutes(1), ScaleActionCooldown = TimeSpan.FromMinutes(5), ScaleActionDirection = ScaleDirection.Increase, ScaleActionScaleType = ScaleType.ChangeCount, ScaleActionValue = "1" }; return(autocaseRuleCmd.CreateSettingRule()); }