public async Task GetServer_NotFound() { Guid serverId = new Guid("0ab41d5f-4c0f-4804-a807-7015ee2adb61"); requestsAndResponses.Add(ApiUris.MyAccount, RequestFileResponseType.AsGoodResponse("GetMyAccountDetails.xml")); requestsAndResponses.Add(ApiUris.GetMcp2Server(accountId, serverId), new RequestFileResponseType { ResponseFile = "GetServerNotFound.xml", Status = HttpStatusCode.BadRequest }); var client = GetWebApiClient(); var accessor = new ServerAccessor(client); await accessor.GetServer(serverId); }
public async Task GetServer_ReturnsResponse() { Guid serverId = new Guid("0fad8eeb-83d7-4703-b450-171c33a79682"); requestsAndResponses.Add(ApiUris.MyAccount, RequestFileResponseType.AsGoodResponse("GetMyAccountDetails.xml")); requestsAndResponses.Add(ApiUris.GetMcp2Server(accountId, serverId), RequestFileResponseType.AsGoodResponse("GetServerResponse.xml")); var client = GetWebApiClient(); var accessor = new ServerAccessor(client); var server = await accessor.GetServer(serverId); Assert.IsNotNull(server); Assert.AreEqual("0fad8eeb-83d7-4703-b450-171c33a79682", server.id); Assert.AreEqual("AU10", server.datacenterId); Assert.AreEqual("6ac5f462-f611-4590-bd3a-b3f66ea93815", server.networkInfo.primaryNic.id); Assert.AreEqual("ecf85a96-e753-429f-a7b7-a455767ac1bd", server.networkInfo.additionalNic.First().id); }