public void TestCreateUserProvidedServiceInstanceResponse()
        {
            string json = @"{
  ""metadata"": {
    ""guid"": ""3fc54066-2df6-454e-b12c-802179bd9487"",
    ""url"": ""/v2/user_provided_service_instances/3fc54066-2df6-454e-b12c-802179bd9487"",
    ""created_at"": ""2015-04-16T12:04:24+00:00"",
    ""updated_at"": null
  },
  ""entity"": {
    ""name"": ""my-user-provided-instance"",
    ""credentials"": {
      ""somekey"": ""somevalue""
    },
    ""space_guid"": ""3f1c865a-0588-471e-b5e5-f9d4a91374bb"",
    ""type"": ""user_provided_service_instance"",
    ""syslog_drain_url"": ""syslog://example.com"",
    ""space_url"": ""/v2/spaces/3f1c865a-0588-471e-b5e5-f9d4a91374bb"",
    ""service_bindings_url"": ""/v2/user_provided_service_instances/3fc54066-2df6-454e-b12c-802179bd9487/service_bindings""
  }
}";

            CreateUserProvidedServiceInstanceResponse obj = Utilities.DeserializeJson <CreateUserProvidedServiceInstanceResponse>(json);

            Assert.AreEqual("3fc54066-2df6-454e-b12c-802179bd9487", TestUtil.ToTestableString(obj.EntityMetadata.Guid), true);
            Assert.AreEqual("/v2/user_provided_service_instances/3fc54066-2df6-454e-b12c-802179bd9487", TestUtil.ToTestableString(obj.EntityMetadata.Url), true);
            Assert.AreEqual("2015-04-16T12:04:24+00:00", TestUtil.ToTestableString(obj.EntityMetadata.CreatedAt), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.EntityMetadata.UpdatedAt), true);
            Assert.AreEqual("my-user-provided-instance", TestUtil.ToTestableString(obj.Name), true);
            Assert.AreEqual("3f1c865a-0588-471e-b5e5-f9d4a91374bb", TestUtil.ToTestableString(obj.SpaceGuid), true);
            Assert.AreEqual("user_provided_service_instance", TestUtil.ToTestableString(obj.Type), true);
            Assert.AreEqual("syslog://example.com", TestUtil.ToTestableString(obj.SyslogDrainUrl), true);
            Assert.AreEqual("/v2/spaces/3f1c865a-0588-471e-b5e5-f9d4a91374bb", TestUtil.ToTestableString(obj.SpaceUrl), true);
            Assert.AreEqual("/v2/user_provided_service_instances/3fc54066-2df6-454e-b12c-802179bd9487/service_bindings", TestUtil.ToTestableString(obj.ServiceBindingsUrl), true);
        }
Пример #2
0
        public void TestCreateUserProvidedServiceInstanceResponse()
        {
            string json = @"{
  ""metadata"": {
    ""guid"": ""6f688ba6-b67b-429f-8f3c-7567f4d324ce"",
    ""url"": ""/v2/user_provided_service_instances/6f688ba6-b67b-429f-8f3c-7567f4d324ce"",
    ""created_at"": ""2016-02-09T10:21:54Z"",
    ""updated_at"": null
  },
  ""entity"": {
    ""name"": ""my-user-provided-instance"",
    ""credentials"": {
      ""somekey"": ""somevalue""
    },
    ""space_guid"": ""ce3dfb93-d41a-41de-9073-2f0c3affc7bd"",
    ""type"": ""user_provided_service_instance"",
    ""syslog_drain_url"": ""syslog://example.com"",
    ""space_url"": ""/v2/spaces/ce3dfb93-d41a-41de-9073-2f0c3affc7bd"",
    ""service_bindings_url"": ""/v2/user_provided_service_instances/6f688ba6-b67b-429f-8f3c-7567f4d324ce/service_bindings""
  }
}";

            CreateUserProvidedServiceInstanceResponse obj = Utilities.DeserializeJson <CreateUserProvidedServiceInstanceResponse>(json);

            Assert.AreEqual("6f688ba6-b67b-429f-8f3c-7567f4d324ce", TestUtil.ToTestableString(obj.EntityMetadata.Guid), true);
            Assert.AreEqual("/v2/user_provided_service_instances/6f688ba6-b67b-429f-8f3c-7567f4d324ce", TestUtil.ToTestableString(obj.EntityMetadata.Url), true);
            Assert.AreEqual("2016-02-09T10:21:54Z", TestUtil.ToTestableString(obj.EntityMetadata.CreatedAt), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.EntityMetadata.UpdatedAt), true);
            Assert.AreEqual("my-user-provided-instance", TestUtil.ToTestableString(obj.Name), true);
            Assert.AreEqual("ce3dfb93-d41a-41de-9073-2f0c3affc7bd", TestUtil.ToTestableString(obj.SpaceGuid), true);
            Assert.AreEqual("user_provided_service_instance", TestUtil.ToTestableString(obj.Type), true);
            Assert.AreEqual("syslog://example.com", TestUtil.ToTestableString(obj.SyslogDrainUrl), true);
            Assert.AreEqual("/v2/spaces/ce3dfb93-d41a-41de-9073-2f0c3affc7bd", TestUtil.ToTestableString(obj.SpaceUrl), true);
            Assert.AreEqual("/v2/user_provided_service_instances/6f688ba6-b67b-429f-8f3c-7567f4d324ce/service_bindings", TestUtil.ToTestableString(obj.ServiceBindingsUrl), true);
        }
Пример #3
0
        public void TestCreateUserProvidedServiceInstanceResponse()
        {
            string json = @"{
  ""metadata"": {
    ""guid"": ""fa9a05b2-6e8b-4bde-8578-a187ed94be36"",
    ""url"": ""/v2/user_provided_service_instances/ae25006c-6430-4ec0-b081-be89424a0471"",
    ""created_at"": ""2016-09-02T11:52:23Z"",
    ""updated_at"": null
  },
  ""entity"": {
    ""name"": ""my-user-provided-instance"",
    ""credentials"": {
      ""somekey"": ""somevalue""
    },
    ""space_guid"": ""fa9a05b2-6e8b-4bde-8578-a187ed94be36"",
    ""type"": ""user_provided_service_instance"",
    ""syslog_drain_url"": ""syslog://example.com"",
    ""route_service_url"": ""https://logger.example.com"",
    ""space_url"": ""/v2/spaces/eed592cb-8d4b-4d0a-973b-a031511e58ef"",
    ""service_bindings_url"": ""/v2/user_provided_service_instances/ae25006c-6430-4ec0-b081-be89424a0471/service_bindings"",
    ""routes_url"": ""/v2/user_provided_service_instances/ae25006c-6430-4ec0-b081-be89424a0471/routes""
  }
}";

            CreateUserProvidedServiceInstanceResponse obj = Utilities.DeserializeJson <CreateUserProvidedServiceInstanceResponse>(json);

            Assert.AreEqual("fa9a05b2-6e8b-4bde-8578-a187ed94be36", TestUtil.ToTestableString(obj.EntityMetadata.Guid), true);
            Assert.AreEqual("/v2/user_provided_service_instances/ae25006c-6430-4ec0-b081-be89424a0471", TestUtil.ToTestableString(obj.EntityMetadata.Url), true);
            Assert.AreEqual("2016-09-02T11:52:23Z", TestUtil.ToTestableString(obj.EntityMetadata.CreatedAt), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.EntityMetadata.UpdatedAt), true);
            Assert.AreEqual("my-user-provided-instance", TestUtil.ToTestableString(obj.Name), true);
            Assert.AreEqual("fa9a05b2-6e8b-4bde-8578-a187ed94be36", TestUtil.ToTestableString(obj.SpaceGuid), true);
            Assert.AreEqual("user_provided_service_instance", TestUtil.ToTestableString(obj.Type), true);
            Assert.AreEqual("syslog://example.com", TestUtil.ToTestableString(obj.SyslogDrainUrl), true);
            Assert.AreEqual("https://logger.example.com", TestUtil.ToTestableString(obj.RouteServiceUrl), true);
            Assert.AreEqual("/v2/spaces/eed592cb-8d4b-4d0a-973b-a031511e58ef", TestUtil.ToTestableString(obj.SpaceUrl), true);
            Assert.AreEqual("/v2/user_provided_service_instances/ae25006c-6430-4ec0-b081-be89424a0471/service_bindings", TestUtil.ToTestableString(obj.ServiceBindingsUrl), true);
            Assert.AreEqual("/v2/user_provided_service_instances/ae25006c-6430-4ec0-b081-be89424a0471/routes", TestUtil.ToTestableString(obj.RoutesUrl), true);
        }