Exemplo n.º 1
0
        public void TestRetrieveServiceResponse()
        {
            string json = @"{
  ""metadata"": {
    ""guid"": ""ba67be21-d957-4033-89b4-ca392f34de82"",
    ""url"": ""/v2/services/7aa6156c-3d4a-4fab-a04f-401408c55380"",
    ""created_at"": ""2016-09-02T11:52:11Z"",
    ""updated_at"": null
  },
  ""entity"": {
    ""label"": ""label-44"",
    ""provider"": null,
    ""url"": null,
    ""description"": ""desc-133"",
    ""long_description"": null,
    ""version"": null,
    ""info_url"": null,
    ""active"": true,
    ""bindable"": true,
    ""unique_id"": ""3f5c60a0-7ee6-4b92-a005-379382c3b305"",
    ""extra"": null,
    ""tags"": [

    ],
    ""requires"": [

    ],
    ""documentation_url"": null,
    ""service_broker_guid"": ""ba67be21-d957-4033-89b4-ca392f34de82"",
    ""plan_updateable"": false,
    ""service_plans_url"": ""/v2/services/7aa6156c-3d4a-4fab-a04f-401408c55380/service_plans""
  }
}";

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

            Assert.AreEqual("ba67be21-d957-4033-89b4-ca392f34de82", TestUtil.ToTestableString(obj.EntityMetadata.Guid), true);
            Assert.AreEqual("/v2/services/7aa6156c-3d4a-4fab-a04f-401408c55380", TestUtil.ToTestableString(obj.EntityMetadata.Url), true);
            Assert.AreEqual("2016-09-02T11:52:11Z", TestUtil.ToTestableString(obj.EntityMetadata.CreatedAt), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.EntityMetadata.UpdatedAt), true);
            Assert.AreEqual("label-44", TestUtil.ToTestableString(obj.Label), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.Provider), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.Url), true);
            Assert.AreEqual("desc-133", TestUtil.ToTestableString(obj.Description), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.LongDescription), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.Version), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.InfoUrl), true);
            Assert.AreEqual("true", TestUtil.ToTestableString(obj.Active), true);
            Assert.AreEqual("true", TestUtil.ToTestableString(obj.Bindable), true);
            Assert.AreEqual("3f5c60a0-7ee6-4b92-a005-379382c3b305", TestUtil.ToTestableString(obj.UniqueId), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.Extra), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.DocumentationUrl), true);
            Assert.AreEqual("ba67be21-d957-4033-89b4-ca392f34de82", TestUtil.ToTestableString(obj.ServiceBrokerGuid), true);
            Assert.AreEqual("false", TestUtil.ToTestableString(obj.PlanUpdateable), true);
            Assert.AreEqual("/v2/services/7aa6156c-3d4a-4fab-a04f-401408c55380/service_plans", TestUtil.ToTestableString(obj.ServicePlansUrl), true);
        }
        public void TestRetrieveServiceResponse()
        {
            string json = @"{
  ""metadata"": {
    ""guid"": ""1e3382c9-a360-4358-85e2-d6c9842b0697"",
    ""url"": ""/v2/services/1e3382c9-a360-4358-85e2-d6c9842b0697"",
    ""created_at"": ""2015-04-16T12:04:16+00:00"",
    ""updated_at"": null
  },
  ""entity"": {
    ""label"": ""label-8"",
    ""provider"": ""provider-8"",
    ""url"": ""https://foo.com/url-12"",
    ""description"": ""desc-30"",
    ""long_description"": null,
    ""version"": ""version-8"",
    ""info_url"": null,
    ""active"": true,
    ""bindable"": true,
    ""unique_id"": ""1e5e02f7-f8bd-4be9-84b2-7407eaa07650"",
    ""extra"": null,
    ""tags"": [

    ],
    ""requires"": [

    ],
    ""documentation_url"": null,
    ""service_broker_guid"": ""7fce336f-ac74-4a44-81a5-91cef1d38e05"",
    ""plan_updateable"": false,
    ""service_plans_url"": ""/v2/services/1e3382c9-a360-4358-85e2-d6c9842b0697/service_plans""
  }
}";

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

            Assert.AreEqual("1e3382c9-a360-4358-85e2-d6c9842b0697", TestUtil.ToTestableString(obj.EntityMetadata.Guid), true);
            Assert.AreEqual("/v2/services/1e3382c9-a360-4358-85e2-d6c9842b0697", TestUtil.ToTestableString(obj.EntityMetadata.Url), true);
            Assert.AreEqual("2015-04-16T12:04:16+00:00", TestUtil.ToTestableString(obj.EntityMetadata.CreatedAt), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.EntityMetadata.UpdatedAt), true);
            Assert.AreEqual("label-8", TestUtil.ToTestableString(obj.Label), true);
            Assert.AreEqual("provider-8", TestUtil.ToTestableString(obj.Provider), true);
            Assert.AreEqual("https://foo.com/url-12", TestUtil.ToTestableString(obj.Url), true);
            Assert.AreEqual("desc-30", TestUtil.ToTestableString(obj.Description), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.LongDescription), true);
            Assert.AreEqual("version-8", TestUtil.ToTestableString(obj.Version), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.InfoUrl), true);
            Assert.AreEqual("true", TestUtil.ToTestableString(obj.Active), true);
            Assert.AreEqual("true", TestUtil.ToTestableString(obj.Bindable), true);
            Assert.AreEqual("1e5e02f7-f8bd-4be9-84b2-7407eaa07650", TestUtil.ToTestableString(obj.UniqueId), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.Extra), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.DocumentationUrl), true);
            Assert.AreEqual("7fce336f-ac74-4a44-81a5-91cef1d38e05", TestUtil.ToTestableString(obj.ServiceBrokerGuid), true);
            Assert.AreEqual("false", TestUtil.ToTestableString(obj.PlanUpdateable), true);
            Assert.AreEqual("/v2/services/1e3382c9-a360-4358-85e2-d6c9842b0697/service_plans", TestUtil.ToTestableString(obj.ServicePlansUrl), true);
        }
Exemplo n.º 3
0
        public void TestRetrieveServiceResponse()
        {
            string json = @"{
  ""metadata"": {
    ""guid"": ""6a64a40b-3a64-4bee-b74e-69c9f10ed755"",
    ""url"": ""/v2/services/6a64a40b-3a64-4bee-b74e-69c9f10ed755"",
    ""created_at"": ""2016-02-09T10:21:54Z"",
    ""updated_at"": null
  },
  ""entity"": {
    ""label"": ""label-59"",
    ""provider"": null,
    ""url"": null,
    ""description"": ""desc-179"",
    ""long_description"": null,
    ""version"": null,
    ""info_url"": null,
    ""active"": true,
    ""bindable"": true,
    ""unique_id"": ""24b4dc28-ae0c-43dd-8d70-b233638eed97"",
    ""extra"": null,
    ""tags"": [

    ],
    ""requires"": [

    ],
    ""documentation_url"": null,
    ""service_broker_guid"": ""0a7ceba7-4e96-4287-9410-79f5cba5a747"",
    ""plan_updateable"": false,
    ""service_plans_url"": ""/v2/services/6a64a40b-3a64-4bee-b74e-69c9f10ed755/service_plans""
  }
}";

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

            Assert.AreEqual("6a64a40b-3a64-4bee-b74e-69c9f10ed755", TestUtil.ToTestableString(obj.EntityMetadata.Guid), true);
            Assert.AreEqual("/v2/services/6a64a40b-3a64-4bee-b74e-69c9f10ed755", 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("label-59", TestUtil.ToTestableString(obj.Label), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.Provider), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.Url), true);
            Assert.AreEqual("desc-179", TestUtil.ToTestableString(obj.Description), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.LongDescription), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.Version), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.InfoUrl), true);
            Assert.AreEqual("true", TestUtil.ToTestableString(obj.Active), true);
            Assert.AreEqual("true", TestUtil.ToTestableString(obj.Bindable), true);
            Assert.AreEqual("24b4dc28-ae0c-43dd-8d70-b233638eed97", TestUtil.ToTestableString(obj.UniqueId), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.Extra), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.DocumentationUrl), true);
            Assert.AreEqual("0a7ceba7-4e96-4287-9410-79f5cba5a747", TestUtil.ToTestableString(obj.ServiceBrokerGuid), true);
            Assert.AreEqual("false", TestUtil.ToTestableString(obj.PlanUpdateable), true);
            Assert.AreEqual("/v2/services/6a64a40b-3a64-4bee-b74e-69c9f10ed755/service_plans", TestUtil.ToTestableString(obj.ServicePlansUrl), true);
        }
Exemplo n.º 4
0
 public Service(
     ListAllServiceInstancesForSpaceResponse service,
     ICollection <GetAppSummaryResponse> appsSummary,
     RetrieveServicePlanResponse servicePlan,
     RetrieveServiceResponse systemService,
     CloudFoundryClient client)
     : base(CloudItemType.Service)
 {
     this.client        = client;
     this.service       = service;
     this.appsSummary   = appsSummary;
     this.servicePlan   = servicePlan;
     this.systemService = systemService;
 }