public void UpdateUserSettings_InvalidEmailFormat() { var contract = new UpdateUserSettingsContract(userWithEmail) { Email = "mikumiku" }; data.UpdateUserSettings(contract); }
public void UpdateUserSettings_EmailTaken() { permissionContext.LoggedUser = new UserWithPermissionsContract(userWithoutEmail, ContentLanguagePreference.Default); var contract = new UpdateUserSettingsContract(userWithoutEmail) { Email = userWithEmail.Email }; data.UpdateUserSettings(contract); }
public void UpdateUserSettings_EmailTakenButDisabled() { userWithEmail.Active = false; permissionContext.LoggedUser = new UserWithPermissionsContract(userWithoutEmail, ContentLanguagePreference.Default); var contract = new UpdateUserSettingsContract(userWithoutEmail) { Email = userWithEmail.Email }; data.UpdateUserSettings(contract); var user = GetUserFromRepo(userWithoutEmail.Name); Assert.IsNotNull(user, "User was found in repository"); Assert.AreEqual("*****@*****.**", user.Email, "Email"); }
public void UpdateUserSettings_SetEmail() { var contract = new UpdateUserSettingsContract(userWithEmail) { Email = "*****@*****.**" }; userWithEmail.Options.EmailVerified = true; var result = data.UpdateUserSettings(contract); Assert.IsNotNull(result, "Result"); var user = GetUserFromRepo(userWithEmail.Name); Assert.IsNotNull(user, "User was found in repository"); Assert.AreEqual("*****@*****.**", user.Email, "Email"); Assert.IsFalse(user.Options.EmailVerified, "EmailVerified"); // Cancel verification }