public void UserDAO_CheckPhoneNumberExistence_PhoneNumberNonExists(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 phone number exists, and set the result accordingly. bool phoneNumberExistence = userDAO.CheckPhoneNumberExistence("0000000000"); //Assert // The result should be false. Assert.IsFalse(phoneNumberExistence); }
/// <summary> /// Checks if the <paramref name="phoneNumber"/> exists in the data store. /// </summary> /// <param name="phoneNumber">Phone number to check (string)</param> /// <returns>Returns true if the phone number exists and false if not.</returns> public static bool CheckPhoneNumberExistence(string phoneNumber) { // Call the check method via the User DAO with the phone number. return(_userDAO.CheckPhoneNumberExistence(phoneNumber)); }