public void CanConvertJsonPayload()
        {
            var expectedPublicUri = "https://region-a.geo-1.block.hpcloudsvc.com/v1/10244656540440";
            var expectedRegion = "region-a.geo-1";
            var expectedVersion = "1.0";
            var expectedVersionList = "https://region-a.geo-1.block.hpcloudsvc.com";
            var expectedVersionInfo = "https://region-a.geo-1.block.hpcloudsvc.com/v1";

            var endpointPayload = @" {
                        ""tenantId"": ""10244656540440"",
                        ""publicURL"": ""https://region-a.geo-1.block.hpcloudsvc.com/v1/10244656540440"",
                        ""publicURL2"": """",
                        ""region"": ""region-a.geo-1"",
                        ""versionId"": ""1.0"",
                        ""versionInfo"": ""https://region-a.geo-1.block.hpcloudsvc.com/v1"",
                        ""versionList"": ""https://region-a.geo-1.block.hpcloudsvc.com""
                    }";

            var converter = new OpenStackServiceEndpointPayloadConverter();
            var endpoint = converter.Convert(endpointPayload);

            Assert.IsNotNull(endpoint);
            Assert.AreEqual(expectedPublicUri, endpoint.PublicUri.ToString());
            Assert.AreEqual(expectedRegion, endpoint.Region);
            Assert.AreEqual(expectedVersion, endpoint.Version);
            Assert.AreEqual(expectedVersionInfo, endpoint.VersionInformation.ToString());
            Assert.AreEqual(expectedVersionList, endpoint.VersionList.ToString());
        }
        public void CannotConvertJsonPayloadWithMissingPublicUri()
        {
            var endpointPayload = @" {
                        ""tenantId"": ""10244656540440"",
                        ""publicURL2"": """",
                        ""region"": ""region-a.geo-1"",
                        ""versionId"": ""1.0"",
                        ""versionInfo"": ""https://region-a.geo-1.block.hpcloudsvc.com/v1"",
                        ""versionList"": ""https://region-a.geo-1.block.hpcloudsvc.com""
                    }";

            var converter = new OpenStackServiceEndpointPayloadConverter();
            converter.Convert(endpointPayload);
        }
 public void CannotConvertWithNullJsonPayload()
 {
     var converter = new OpenStackServiceEndpointPayloadConverter();
     converter.Convert(null);
 }
        public void CannotConvertNonObjectJsonPayload()
        {
            var endpointPayload = @" [] ";

            var converter = new OpenStackServiceEndpointPayloadConverter();
            converter.Convert(endpointPayload);
        }
        public void CannotConvertInvalidJsonPayload()
        {
            var endpointPayload = @" { NOT JSON";

            var converter = new OpenStackServiceEndpointPayloadConverter();
            converter.Convert(endpointPayload);
        }