Ejemplo n.º 1
0
		public void UpdateUserSettings_InvalidEmailFormat() {

			var contract = new UpdateUserSettingsContract(userWithEmail) { Email = "mikumiku" };

			data.UpdateUserSettings(contract);

		}
Ejemplo n.º 2
0
		public void UpdateUserSettings_EmailTaken() {

			permissionContext.LoggedUser = new UserWithPermissionsContract(userWithoutEmail, ContentLanguagePreference.Default);
			var contract = new UpdateUserSettingsContract(userWithoutEmail) { Email = userWithEmail.Email };

			data.UpdateUserSettings(contract);

		}
Ejemplo n.º 3
0
		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");

		}
Ejemplo n.º 4
0
		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

		}