예제 #1
0
 public NewAzureRmAutoscaleRuleTests()
 {
     commandRuntimeMock = new Mock <ICommandRuntime>();
     Cmdlet             = new NewAzureRmAutoscaleRuleCommand()
     {
         CommandRuntime = commandRuntimeMock.Object
     };
 }
 public NewAzureRmAutoscaleRuleTests(Xunit.Abstractions.ITestOutputHelper output)
 {
     //ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output));
     commandRuntimeMock = new Mock <ICommandRuntime>();
     Cmdlet             = new NewAzureRmAutoscaleRuleCommand()
     {
         CommandRuntime = commandRuntimeMock.Object
     };
 }
        private ScaleRule CreateAutoscaleRule(string metricName = null)
        {
            var autocaseRuleCmd = new NewAzureRmAutoscaleRuleCommand
            {
                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,
                ScaleActionValue     = "1"
            };

            return(autocaseRuleCmd.CreateSettingRule());
        }