public async Task GetFloatingIpsFormsCorrectUrlAndMethod() { var client = new NetworkServiceRestClient(GetValidContext(), this.ServiceLocator); await client.GetFloatingIps(); Assert.AreEqual(string.Format("{0}/floatingips", endpoint + "v2.0"), this.simulator.Uri.ToString()); Assert.AreEqual(HttpMethod.Get, this.simulator.Method); }
public async Task CanGetFloatingIps() { this.simulator.FloatingIps.Add(new OpenStack.Network.FloatingIp("12345", "172.0.0.1", FloatingIpStatus.Active)); var client = new NetworkServiceRestClient(GetValidContext(), this.ServiceLocator); var resp = await client.GetFloatingIps(); Assert.AreEqual(HttpStatusCode.OK, resp.StatusCode); var respContent = TestHelper.GetStringFromStream(resp.Content); Assert.IsTrue(respContent.Length > 0); }
public async Task GetFloatingIpsIncludesAuthHeader() { var client = new NetworkServiceRestClient(GetValidContext(), this.ServiceLocator); await client.GetFloatingIps(); Assert.IsTrue(this.simulator.Headers.ContainsKey("X-Auth-Token")); Assert.AreEqual(this.authId, this.simulator.Headers["X-Auth-Token"]); }