コード例 #1
0
        public HttpResponseMessage Post([FromUri] string alias, [FromBody] MockAlertPolicy policy)
        {
            policy.id = Guid.NewGuid().ToString();
            Users.ByAccountAlias[alias].AlertPolicies.Add(policy.id, policy);

            return(Request.CreateResponse(HttpStatusCode.OK, policy));
        }
コード例 #2
0
 private static void AssertPoliciesEqual(AlertPolicy policy, MockAlertPolicy mock)
 {
     Assert.AreEqual(policy.Id, mock.id);
     Assert.AreEqual(policy.Name, mock.name);
     AssertMockActionsEqual(policy.Actions, mock.actions);
     AssertMockTriggersEqual(policy.Triggers, mock.triggers);
 }
コード例 #3
0
        public HttpResponseMessage Put([FromUri] string alias, [FromUri] string id, [FromBody] MockAlertPolicy policy)
        {
            Users.ByAccountAlias[alias].AlertPolicies[id] = policy;

            return(Request.CreateResponse(HttpStatusCode.OK, policy));
        }