public async Task GetNetworksIncludesAuthHeader()
        {
            var client =
                new NetworkServiceRestClient(GetValidContext(), this.ServiceLocator);

            await client.GetNetworks();

            Assert.IsTrue(this.simulator.Headers.ContainsKey("X-Auth-Token"));
            Assert.AreEqual(this.authId, this.simulator.Headers["X-Auth-Token"]);
        }
        public async Task CanGetNetworks()
        {
            this.simulator.Networks.Add(new OpenStack.Network.Network("12345","MyNetwork", NetworkStatus.Active));

            var client =
               new NetworkServiceRestClient(GetValidContext(), this.ServiceLocator);

            var resp = await client.GetNetworks();

            Assert.AreEqual(HttpStatusCode.OK, resp.StatusCode);

            var respContent = TestHelper.GetStringFromStream(resp.Content);
            Assert.IsTrue(respContent.Length > 0);
        }
        public async Task GetNetworksFormsCorrectUrlAndMethod()
        {
            var client =
                new NetworkServiceRestClient(GetValidContext(), this.ServiceLocator);

            await client.GetNetworks();

            Assert.AreEqual(string.Format("{0}/networks", endpoint +"v2.0"), this.simulator.Uri.ToString());
            Assert.AreEqual(HttpMethod.Get, this.simulator.Method);
        }