public async Task TestConfirmDeliveryReportsAsReceived1() { // Parameters for the API call ConfirmDeliveryReportsAsReceivedRequest body = APIHelper.JsonDeserialize <Models.ConfirmDeliveryReportsAsReceivedRequest>("{ \"delivery_report_ids\": [ \"011dcead-6988-4ad6-a1c7-6b6c68ea628d\", \"3487b3fa-6586-4979-a233-2d1b095c7718\", \"ba28e94b-c83d-4759-98e7-ff9c7edb87a1\" ]}"); // Perform API call dynamic result = null; try { result = await controller.CreateConfirmDeliveryReportsAsReceivedAsync(body); } catch (APIException) {}; // Test response code Assert.AreEqual(202, httpCallBackHandler.Response.StatusCode, "Status should be 202"); // Test headers Dictionary <string, string> headers = new Dictionary <string, string>(); headers.Add("Content-Type", null); Assert.IsTrue(TestHelper.AreHeadersProperSubsetOf( headers, httpCallBackHandler.Response.Headers), "Headers should match"); }
public async Task TestConfirmDeliveryReportsAsReceivedWithInvalidAccount() { // Parameters for the API call ConfirmDeliveryReportsAsReceivedRequest body = APIHelper.JsonDeserialize <Models.ConfirmDeliveryReportsAsReceivedRequest>("{ \"delivery_report_ids\": [ \"011dcead-6988-4ad6-a1c7-6b6c68ea628d\", \"3487b3fa-6586-4979-a233-2d1b095c7718\", \"ba28e94b-c83d-4759-98e7-ff9c7edb87a1\" ]}"); // Perform API call dynamic result = null; try { result = await controller.CreateConfirmDeliveryReportsAsReceivedAsync(body, "INVALID ACCOUNT"); } catch (APIException apiException) { Assert.AreEqual("HTTP Response Not OK. {\"message\":\"Invalid account 'INVALID ACCOUNT' in header Account\"}\n", apiException.Message); Assert.AreEqual(403, httpCallBackHandler.Response.StatusCode, "Status should be 403"); }; }