コード例 #1
0
        public void TestCreateServicePlanDeprecatedResponse()
        {
            string json = @"{
  ""metadata"": {
    ""guid"": ""dc5c468a-3b14-41f5-8f4d-520430f16d27"",
    ""url"": ""/v2/service_plans/dc5c468a-3b14-41f5-8f4d-520430f16d27"",
    ""created_at"": ""2015-04-16T12:04:29+00:00"",
    ""updated_at"": null
  },
  ""entity"": {
    ""name"": ""100mb"",
    ""free"": true,
    ""description"": ""Let's you put data in your database!"",
    ""service_guid"": ""97cdef48-22fa-4901-944a-e943586677bd"",
    ""extra"": null,
    ""unique_id"": ""4a42521f-9e4a-4407-936f-795e997cecb2"",
    ""public"": true,
    ""active"": true,
    ""service_url"": ""/v2/services/97cdef48-22fa-4901-944a-e943586677bd"",
    ""service_instances_url"": ""/v2/service_plans/dc5c468a-3b14-41f5-8f4d-520430f16d27/service_instances""
  }
}";

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

            Assert.AreEqual("dc5c468a-3b14-41f5-8f4d-520430f16d27", TestUtil.ToTestableString(obj.EntityMetadata.Guid), true);
            Assert.AreEqual("/v2/service_plans/dc5c468a-3b14-41f5-8f4d-520430f16d27", TestUtil.ToTestableString(obj.EntityMetadata.Url), true);
            Assert.AreEqual("2015-04-16T12:04:29+00:00", TestUtil.ToTestableString(obj.EntityMetadata.CreatedAt), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.EntityMetadata.UpdatedAt), true);
            Assert.AreEqual("100mb", TestUtil.ToTestableString(obj.Name), true);
            Assert.AreEqual("true", TestUtil.ToTestableString(obj.Free), true);
            Assert.AreEqual("Let's you put data in your database!", TestUtil.ToTestableString(obj.Description), true);
            Assert.AreEqual("97cdef48-22fa-4901-944a-e943586677bd", TestUtil.ToTestableString(obj.ServiceGuid), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.Extra), true);
            Assert.AreEqual("4a42521f-9e4a-4407-936f-795e997cecb2", TestUtil.ToTestableString(obj.UniqueId), true);
            Assert.AreEqual("true", TestUtil.ToTestableString(obj.Public), true);
            Assert.AreEqual("true", TestUtil.ToTestableString(obj.Active), true);
            Assert.AreEqual("/v2/services/97cdef48-22fa-4901-944a-e943586677bd", TestUtil.ToTestableString(obj.ServiceUrl), true);
            Assert.AreEqual("/v2/service_plans/dc5c468a-3b14-41f5-8f4d-520430f16d27/service_instances", TestUtil.ToTestableString(obj.ServiceInstancesUrl), true);
        }
コード例 #2
0
        public void TestCreateServicePlanDeprecatedResponse()
        {
            string json = @"{
  ""metadata"": {
    ""guid"": ""fd3f70a8-eaf1-4b46-a35a-652dbc3542ca"",
    ""url"": ""/v2/service_plans/fd3f70a8-eaf1-4b46-a35a-652dbc3542ca"",
    ""created_at"": ""2016-02-09T10:21:42Z"",
    ""updated_at"": null
  },
  ""entity"": {
    ""name"": ""100mb"",
    ""free"": true,
    ""description"": ""Let's you put data in your database!"",
    ""service_guid"": ""2d03c09b-e0fb-4cd2-a47d-3392fe3663b7"",
    ""extra"": null,
    ""unique_id"": ""b9708803-b407-4934-a495-5cc7dec3cc62"",
    ""public"": true,
    ""active"": true,
    ""service_url"": ""/v2/services/2d03c09b-e0fb-4cd2-a47d-3392fe3663b7"",
    ""service_instances_url"": ""/v2/service_plans/fd3f70a8-eaf1-4b46-a35a-652dbc3542ca/service_instances""
  }
}";

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

            Assert.AreEqual("fd3f70a8-eaf1-4b46-a35a-652dbc3542ca", TestUtil.ToTestableString(obj.EntityMetadata.Guid), true);
            Assert.AreEqual("/v2/service_plans/fd3f70a8-eaf1-4b46-a35a-652dbc3542ca", TestUtil.ToTestableString(obj.EntityMetadata.Url), true);
            Assert.AreEqual("2016-02-09T10:21:42Z", TestUtil.ToTestableString(obj.EntityMetadata.CreatedAt), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.EntityMetadata.UpdatedAt), true);
            Assert.AreEqual("100mb", TestUtil.ToTestableString(obj.Name), true);
            Assert.AreEqual("true", TestUtil.ToTestableString(obj.Free), true);
            Assert.AreEqual("Let's you put data in your database!", TestUtil.ToTestableString(obj.Description), true);
            Assert.AreEqual("2d03c09b-e0fb-4cd2-a47d-3392fe3663b7", TestUtil.ToTestableString(obj.ServiceGuid), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.Extra), true);
            Assert.AreEqual("b9708803-b407-4934-a495-5cc7dec3cc62", TestUtil.ToTestableString(obj.UniqueId), true);
            Assert.AreEqual("true", TestUtil.ToTestableString(obj.Public), true);
            Assert.AreEqual("true", TestUtil.ToTestableString(obj.Active), true);
            Assert.AreEqual("/v2/services/2d03c09b-e0fb-4cd2-a47d-3392fe3663b7", TestUtil.ToTestableString(obj.ServiceUrl), true);
            Assert.AreEqual("/v2/service_plans/fd3f70a8-eaf1-4b46-a35a-652dbc3542ca/service_instances", TestUtil.ToTestableString(obj.ServiceInstancesUrl), true);
        }