public void CreateNewUserWithoutRights() { TiskarnaVosahlo.Autentication.LogIn(GUEST_USERNAME, GUEST_PASSWORD); IUserManagement userManagement = TiskarnaVosahlo.UserManagement; Assert.That(() => userManagement.CreateNewUser(USERNAME, PASSWORD), Throws.TypeOf <RightsException>()); }
public void CreateNewUserAlreadyExist() { TiskarnaVosahlo.Autentication.LogIn(MASTER_USERNAME, MASTER_PASSWORD); IUserManagement userManagement = TiskarnaVosahlo.UserManagement; IUser newUser = userManagement.CreateNewUser(USERNAME, PASSWORD); try { Assert.That(() => userManagement.CreateNewUser(USERNAME, PASSWORD), Throws.TypeOf <UserManagementException>()); } finally { userManagement.DeleteUser(newUser); } }
public void CreateNewUserEmptyPassword() { TiskarnaVosahlo.Autentication.LogIn(MASTER_USERNAME, MASTER_PASSWORD); IUserManagement userManagement = TiskarnaVosahlo.UserManagement; Assert.That(() => userManagement.CreateNewUser(USERNAME, ""), Throws.TypeOf <UserManagementException>()); }
public void DeleteUser() { TiskarnaVosahlo.Autentication.LogIn(MASTER_USERNAME, MASTER_PASSWORD); IUserManagement userManagement = TiskarnaVosahlo.UserManagement; IUser newUser = userManagement.CreateNewUser(USERNAME, PASSWORD); userManagement.DeleteUser(newUser); }
private void AddTestUser() { TiskarnaVosahlo.Autentication.LogIn(MASTER_USERNAME, MASTER_PASSWORD); IUserManagement userManagement = TiskarnaVosahlo.UserManagement; userManagement.CreateNewUser(USERNAME, PASSWORD); UserContext.Logout(); }
public void SaveUser() { TiskarnaVosahlo.Autentication.LogIn(MASTER_USERNAME, MASTER_PASSWORD); IUserManagement userManagement = TiskarnaVosahlo.UserManagement; IUser newUser = userManagement.CreateNewUser(USERNAME, PASSWORD); Assert.True(userManagement.Users.Contains(newUser)); userManagement.DeleteUser(newUser); }
public void CreateNewUser() { TiskarnaVosahlo.Autentication.LogIn(MASTER_USERNAME, MASTER_PASSWORD); IUserManagement userManagement = TiskarnaVosahlo.UserManagement; IUser newUser = userManagement.CreateNewUser(USERNAME, PASSWORD); Assert.AreEqual(newUser.Username, USERNAME); Assert.AreEqual(newUser.Password, PASSWORD); userManagement.DeleteUser(newUser); }
public void UpdateUserFromDb() { TiskarnaVosahlo.Autentication.LogIn(MASTER_USERNAME, MASTER_PASSWORD); IUserManagement userManagement = TiskarnaVosahlo.UserManagement; IUser newUser = userManagement.CreateNewUser(USERNAME, PASSWORD); newUser.Username = NEW_USERNAME; newUser.Password = NEW_PASSWORD; newUser.Save(); newUser.Reload(); Assert.AreEqual(newUser.Username, NEW_USERNAME); Assert.AreEqual(newUser.Password, NEW_PASSWORD); userManagement.DeleteUser(newUser); }