예제 #1
0
 /// <summary>
 /// Initializes a new instance of the PSAlertRule class.
 /// </summary>
 /// <param name="ruleSpec"></param>
 public PSAlertRuleNoDetails(RuleResource ruleSpec)
 {
     this.Id         = ruleSpec.Id;
     this.Location   = ruleSpec.Location;
     this.Name       = ruleSpec.Name;
     this.Properties = ruleSpec.Properties;
     this.Tags       = ruleSpec.Tags;
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the PSAlertRule class.
 /// </summary>
 /// <param name="ruleSpec"></param>
 public PSAlertRule(RuleResource ruleSpec)
 {
     this.Id         = ruleSpec.Id;
     this.Location   = ruleSpec.Location;
     this.Name       = ruleSpec.Name;
     this.Properties = new PSAlertRuleProperty(ruleSpec.Properties);
     this.Tags       = new PSDictionaryElement(ruleSpec.Tags);
 }
 private void AreEqual(RuleResource exp, RuleResource act)
 {
     if (exp != null)
     {
         Assert.Equal(exp.Id, act.Id);
         Assert.Equal(exp.Location, act.Location);
         Assert.Equal(exp.Name, act.Name);
         AreEqual(exp.Tags, act.Tags);
         AreEqual(exp.Properties, act.Properties);
     }
 }
예제 #4
0
        public static RuleGetResponse InitializeRuleGetResponse()
        {
            // This is effectively testing the conversion EventData -> PSEventData internally in the execution of the cmdlet
            RuleResource ruleResource = Utilities.CreateFakeRuleResource();

            return(new RuleGetResponse()
            {
                Id = ruleResource.Id,
                Location = ruleResource.Location,
                Name = ruleResource.Name,
                Properties = ruleResource.Properties,
                Tags = ruleResource.Tags,
                RequestId = Guid.NewGuid().ToString(),
                StatusCode = HttpStatusCode.OK
            });
        }
예제 #5
0
        public static RuleListResponse InitializeRuleListResponse()
        {
            // This is effectively testing the conversion EventData -> PSEventData internally in the execution of the cmdlet
            RuleResource ruleResource = Utilities.CreateFakeRuleResource();

            return(new RuleListResponse()
            {
                RuleResourceCollection = new RuleResourceCollection()
                {
                    Value = new List <RuleResource>()
                    {
                        ruleResource
                    },
                },
                RequestId = Guid.NewGuid().ToString(),
                StatusCode = HttpStatusCode.OK
            });
        }