ServiceClientContext GetValidContext(CancellationToken token)
        {
            var creds = new OpenStackCredential(this.endpoint, "SomeUser", "Password", "SomeTenant", "region-a.geo-1");
            creds.SetAccessTokenId(this.authId);

            return new ServiceClientContext(creds, token, "Nova", endpoint);
        }
        IOpenStackCredential GetValidCreds()
        {
            var authId = "12345";
            var endpoint = "http://teststorageendpoint.com/v1/1234567890";

            var creds = new OpenStackCredential(new Uri(endpoint), "SomeUser", "Password", "SomeTenant");
            creds.SetAccessTokenId(authId);
            return creds;
        }
        public void CannotSetAcessTokenIdWithNullToken()
        {
            var endpoint = new Uri("https://auth.someplace.com/authme");
            var userName = "******";
            var password = "******";
            var tenantId = "12345";

            var cred = new OpenStackCredential(endpoint, userName, password, tenantId);
            cred.SetAccessTokenId(null);
        }
        public void CanSetAcessTokenId()
        {
            var endpoint = new Uri("https://auth.someplace.com/authme");
            var userName = "******";
            var password = "******";
            var tenantId = "12345";
            var token = "someToken";

            var cred = new OpenStackCredential(endpoint, userName, password, tenantId);
            cred.SetAccessTokenId(token);

            Assert.AreEqual(token, cred.AccessTokenId);
        }
        IOpenStackCredential GetValidCreds()
        {
            var catalog = new OpenStackServiceCatalog();
            catalog.Add(new OpenStackServiceDefinition("Neutron", "Network Service",
                new List<OpenStackServiceEndpoint>()
                {
                    new OpenStackServiceEndpoint(endpoint, string.Empty, "some version", "some version info", "1,2,3")
                }));

            var creds = new OpenStackCredential(new Uri(this.endpoint), "SomeUser", "Password", "SomeTenant");
            creds.SetAccessTokenId(this.authId);
            creds.SetServiceCatalog(catalog);
            return creds;
        }