public void UserDAO_CheckEmailExistence_EmailNonExists(string username, string name, string email, string phoneNumber, string password, int disabled, string userType, string salt, long tempTimestamp, string emailCode, long emailCodeTimestamp, int loginFailures, long lastLoginFailTimestamp, int emailCodeFailures, int phoneCodeFailures) { //Arrange UnitTestUserDAO userDAO = new UnitTestUserDAO(); // Create a user for the test. UserRecord userRecord = new UserRecord(username, name, email, phoneNumber, password, disabled, userType, salt, tempTimestamp, emailCode, emailCodeTimestamp, loginFailures, lastLoginFailTimestamp, emailCodeFailures, phoneCodeFailures); userDAO.Create(userRecord); //Act // Check if the email exists, and set the result accordingly. bool emailExistence = userDAO.CheckEmailExistence("nonExistingEmail"); //Assert // The result should be false. Assert.IsFalse(emailExistence); }
/// <summary> /// Checks if the <paramref name="email"/> exists in the data store. /// </summary> /// <param name="email">Email to check (string)</param> /// <returns>Returns true if the email exists and false if not.</returns> public static bool CheckEmailExistence(string email) { // Call the check method via the User DAO with the email. return(_userDAO.CheckEmailExistence(email)); }