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\": \"ZV00000000000000000000000000000000\",\"account_sid\": \"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"service_sid\": \"ZS00000000000000000000000000000000\",\"environment_sid\": \"ZE00000000000000000000000000000000\",\"key\": \"new-key\",\"value\": \"new-value\",\"date_created\": \"2018-11-10T20:00:00Z\",\"date_updated\": \"2018-11-10T20:00:00Z\",\"url\": \"https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Variables/ZV00000000000000000000000000000000\"}"
                         ));

            var response = VariableResource.Create("ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "key", "value", client: twilioRestClient);

            Assert.NotNull(response);
        }
        public void TestCreateRequest()
        {
            var twilioRestClient = Substitute.For <ITwilioRestClient>();
            var request          = new Request(
                HttpMethod.Post,
                Twilio.Rest.Domain.Serverless,
                "/v1/Services/ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Environments/ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Variables",
                ""
                );

            request.AddPostParam("Key", Serialize("key"));
            request.AddPostParam("Value", Serialize("value"));
            twilioRestClient.Request(request).Throws(new ApiException("Server Error, no content"));

            try
            {
                VariableResource.Create("ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "key", "value", client: twilioRestClient);
                Assert.Fail("Expected TwilioException to be thrown for 500");
            }
            catch (ApiException) {}
            twilioRestClient.Received().Request(request);
        }