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)); }
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); }
public HttpResponseMessage Put([FromUri] string alias, [FromUri] string id, [FromBody] MockAlertPolicy policy) { Users.ByAccountAlias[alias].AlertPolicies[id] = policy; return(Request.CreateResponse(HttpStatusCode.OK, policy)); }