public void DeleteTest() { using (var server = new HttpServer(new[] { new RequestHandler { EstimatedMethod = "DELETE", EstimatedPathAndQuery = string.Format("/v1.0/accounts/{0}/subscriptions/1", Helper.AccountId), } })) { var client = Helper.CreateClient(); var i = new Subscription { Id = "1" }; i.SetClient(client); i.Delete().Wait(); if (server.Error != null) throw server.Error; } }
public void UpdateTest() { var item = new Subscription { OrderType = "orders", OrderId = "100", EmailSubscription = new EmailSubscription { Email = "test@test", DigestRequested = "NONE" } }; using (var server = new HttpServer(new[] { new RequestHandler { EstimatedMethod = "PUT", EstimatedPathAndQuery = string.Format("/v1.0/accounts/{0}/subscriptions/1", Helper.AccountId), EstimatedContent = Helper.ToXmlString(item) } })) { var client = Helper.CreateClient(); var i = new Subscription {Id = "1"}; i.SetClient(client); i.Update(item).Wait(); if (server.Error != null) throw server.Error; } }