public void TestCreateResponse()
        {
            var twilioRestClient = Substitute.For <ITwilioRestClient>();

            twilioRestClient.AccountSid.Returns("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
            twilioRestClient.Request(Arg.Any <Request>())
            .Returns(new Response(
                         System.Net.HttpStatusCode.Created,
                         "{\"sid\": \"RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"account_sid\": \"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"friendly_name\": \"friendly_name\",\"mime_type\": \"mime_type\",\"status\": \"draft\",\"type\": \"type\",\"attributes\": {\"first_name\": \"foo\",\"last_name\": \"bar\"},\"date_created\": \"2019-07-31T02:11:52Z\",\"date_updated\": \"2019-07-31T02:11:52Z\",\"url\": \"https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"}"
                         ));

            var response = SupportingDocumentResource.Create("friendly_name", "type", client: twilioRestClient);

            Assert.NotNull(response);
        }
        public void TestCreateRequest()
        {
            var twilioRestClient = Substitute.For <ITwilioRestClient>();
            var request          = new Request(
                HttpMethod.Post,
                Twilio.Rest.Domain.Numbers,
                "/v2/RegulatoryCompliance/SupportingDocuments",
                ""
                );

            request.AddPostParam("FriendlyName", Serialize("friendly_name"));
            request.AddPostParam("Type", Serialize("type"));
            twilioRestClient.Request(request).Throws(new ApiException("Server Error, no content"));

            try
            {
                SupportingDocumentResource.Create("friendly_name", "type", client: twilioRestClient);
                Assert.Fail("Expected TwilioException to be thrown for 500");
            }
            catch (ApiException) {}
            twilioRestClient.Received().Request(request);
        }