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\": \"BN0044409f7e067e279523808d267e2d85\",\"account_sid\": \"AC78e8e67fc0246521490fb9907fd0c165\",\"customer_profile_bundle_sid\": \"BU0000009f7e067e279523808d267e2d90\",\"a2p_profile_bundle_sid\": \"BU1111109f7e067e279523808d267e2d85\",\"date_created\": \"2021-01-28T10:45:51Z\",\"date_updated\": \"2021-01-28T10:45:51Z\",\"status\": \"PENDING\",\"tcr_id\": \"BXXXXXX\",\"failure_reason\": \"Registration error\",\"url\": \"https://messaging.twilio.com/v1/a2p/BrandRegistrations/BN0044409f7e067e279523808d267e2d85\"}"
                         ));

            var response = BrandRegistrationResource.Create("BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", client: twilioRestClient);

            Assert.NotNull(response);
        }
        public void TestCreateRequest()
        {
            var twilioRestClient = Substitute.For <ITwilioRestClient>();
            var request          = new Request(
                HttpMethod.Post,
                Twilio.Rest.Domain.Messaging,
                "/v1/a2p/BrandRegistrations",
                ""
                );

            request.AddPostParam("CustomerProfileBundleSid", Serialize("BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));
            request.AddPostParam("A2PProfileBundleSid", Serialize("BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));
            twilioRestClient.Request(request).Throws(new ApiException("Server Error, no content"));

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