Ejemplo n.º 1
0
        public void TestGetProcessFromAppResponse()
        {
            string json = @"{
  ""guid"": ""b38eec76-cfb7-4a60-8b06-764beaca64c2"",
  ""type"": ""web"",
  ""command"": null,
  ""instances"": 1,
  ""created_at"": ""2015-06-30T07:10:28Z"",
  ""updated_at"": ""2015-06-30T07:10:28Z"",
  ""_links"": {
    ""self"": {
      ""href"": ""/v3/processes/b38eec76-cfb7-4a60-8b06-764beaca64c2""
    },
    ""scale"": {
      ""href"": ""/v3/processes/b38eec76-cfb7-4a60-8b06-764beaca64c2/scale"",
      ""method"": ""PUT""
    },
    ""app"": {
      ""href"": ""/v3/apps/guid-45c11e27-ba71-4514-b2e8-a7599ced166d""
    },
    ""space"": {
      ""href"": ""/v2/spaces/056168e8-eaf8-4b7a-a710-58d2be6ec168""
    }
  }
}";

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

            Assert.AreEqual("b38eec76-cfb7-4a60-8b06-764beaca64c2", TestUtil.ToTestableString(obj.Guid), true);
            Assert.AreEqual("web", TestUtil.ToTestableString(obj.Type), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.Command), true);
            Assert.AreEqual("1", TestUtil.ToTestableString(obj.Instances), true);
            Assert.AreEqual("2015-06-30T07:10:28Z", TestUtil.ToTestableString(obj.CreatedAt), true);
            Assert.AreEqual("2015-06-30T07:10:28Z", TestUtil.ToTestableString(obj.UpdatedAt), true);
        }
Ejemplo n.º 2
0
        public void TestGetProcessFromAppResponse()
        {
            string json = @"{
  ""guid"": ""4ba5da6e-477e-4525-bb6e-0de142df380c"",
  ""type"": ""web"",
  ""command"": null,
  ""instances"": 1,
  ""memory_in_mb"": 1024,
  ""disk_in_mb"": 1024,
  ""created_at"": ""2016-07-07T09:16:54Z"",
  ""updated_at"": ""2016-07-07T09:16:54Z"",
  ""links"": {
    ""self"": {
      ""href"": ""/v3/processes/ef9e0c17-c6dd-451c-8eb8-adcb5f911b2e""
    },
    ""scale"": {
      ""href"": ""/v3/processes/ef9e0c17-c6dd-451c-8eb8-adcb5f911b2e/scale"",
      ""method"": ""PUT""
    },
    ""app"": {
      ""href"": ""/v3/apps/543eff4d-e2f6-4602-a701-bc8dcdfdb651""
    },
    ""space"": {
      ""href"": ""/v2/spaces/d01b7177-bfd3-47b8-8108-48282d326451""
    }
  }
}";

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

            Assert.AreEqual("4ba5da6e-477e-4525-bb6e-0de142df380c", TestUtil.ToTestableString(obj.Guid), true);
            Assert.AreEqual("web", TestUtil.ToTestableString(obj.Type), true);
            Assert.AreEqual("", TestUtil.ToTestableString(obj.Command), true);
            Assert.AreEqual("1", TestUtil.ToTestableString(obj.Instances), true);
            Assert.AreEqual("1024", TestUtil.ToTestableString(obj.MemoryInMb), true);
            Assert.AreEqual("1024", TestUtil.ToTestableString(obj.DiskInMb), true);
            Assert.AreEqual("2016-07-07T09:16:54Z", TestUtil.ToTestableString(obj.CreatedAt), true);
            Assert.AreEqual("2016-07-07T09:16:54Z", TestUtil.ToTestableString(obj.UpdatedAt), true);
        }