Example #1
0
        public void Should_Update_NewUser_Username_And_Email_And_Default_Region_When_Requesting_As_User_Admin()
        {
            IIdentityProvider provider = new IdentityProvider(_testIdentity);

            var user = new User
            {
                Id = _testUser.Id,
                Username = "******",
                Email = "*****@*****.**",
                Enabled = true,
                DefaultRegion = "DFW"
            };
            var updatedUser = provider.UpdateUser(user);

            Assert.IsNotNull(updatedUser);
            Assert.AreEqual("openstacknettestuser32", updatedUser.Username);
            Assert.AreEqual("*****@*****.**", updatedUser.Email);
            Assert.AreEqual(true, updatedUser.Enabled);
            Assert.AreEqual("DFW", updatedUser.DefaultRegion);
        }
Example #2
0
        public void Should_Update_NewUser_Username_And_Email_When_Requesting_As_Self()
        {
            IIdentityProvider provider = new IdentityProvider(new RackspaceCloudIdentity { Username = _testUser.Username, Password = _newTestUserPassword });

            var user = new User
            {
                Id = _testUser.Id,
                Username = "******",
                Email = "*****@*****.**",
                Enabled = true,
            };
            var updatedUser = provider.UpdateUser(user);

            Assert.IsNotNull(updatedUser);
            Assert.AreEqual("openstacknettestuser42", updatedUser.Username);
            Assert.AreEqual("*****@*****.**", updatedUser.Email);
            Assert.AreEqual(true, updatedUser.Enabled);
        }
Example #3
0
        public void Should_Update_NewUser_Username_And_Email_When_Requesting_As_User_Admin()
        {
            IIdentityProvider provider = new IdentityProvider();

            var user = new User
                           {
                               Id = _newTestUser1.Id,
                               Username = "******",
                               Email = "*****@*****.**",
                               Enabled = true
                           };
            var updatedUser = provider.UpdateUser(_testIdentity, user);

            Assert.IsNotNull(updatedUser);
            Assert.AreEqual("openstacknettestuser12", updatedUser.Username);
            Assert.AreEqual("*****@*****.**", updatedUser.Email);
            Assert.AreEqual(true, updatedUser.Enabled);
            Assert.IsTrue(string.IsNullOrWhiteSpace(updatedUser.DefaultRegion));
        }