public void Should_be_able_to_create_a_user() { var userInfo = new UserInfo(testUser, "topSecret").AddTag("administrator"); var user = managementClient.CreateUser(userInfo); user.Name.ShouldEqual(testUser); }
public void Should_be_able_to_change_the_password_of_a_user() { var userInfo = new UserInfo(testUser, "topSecret").AddTag("monitoring").AddTag("management"); var user = managementClient.CreateUser(userInfo); var updatedUser = managementClient.ChangeUserPassword(testUser, "newPassword"); updatedUser.Name.ShouldEqual(user.Name); updatedUser.Tags.ShouldEqual(user.Tags); updatedUser.PasswordHash.ShouldNotEqual(user.PasswordHash); }
public void SetUp() { userInfo = new UserInfo(userName, password); }
public void Should_be_able_to_create_permissions_in_default_Vhost() { var user = managementClient.GetUsers().SingleOrDefault(x => x.Name == testUser); if (user == null) { //create user if it does not exists var userInfo = new UserInfo(testUser, "topSecret").AddTag("administrator"); user = managementClient.CreateUser(userInfo); } var vhost = managementClient.GetVHosts().SingleOrDefault(x => x.Name == vhostName); if (vhost == null) { throw new ApplicationException(string.Format("Default vhost: '{0}' has not been created", testVHost)); } var permissionInfo = new PermissionInfo(user, vhost); managementClient.CreatePermission(permissionInfo); }
public void Should_be_able_to_create_a_user_with_the_policymaker_tag() { var userInfo = new UserInfo(testUser, "topSecret").AddTag("policymaker"); var user = managementClient.CreateUser(userInfo); user.Name.ShouldEqual(testUser); }