public void UserDAO_DeleteByIds_SuccessfulDeletion
            (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

            // Delete the user.
            userDAO.DeleteByIds(new List <string> {
                username
            });
            // Check if the user exists and set the result accordingly.
            bool result = userDAO.CheckUserExistence(username);

            //Assert

            // The result should be false.
            Assert.IsFalse(result);
        }
        public void UserDAO_CheckUserExistence_UserNonExists(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 user exists, and set the result accordingly.
            bool userExistence = userDAO.CheckUserExistence(NonExistingUsername);

            //Assert

            // The result should be false.
            Assert.IsFalse(userExistence);
        }
 /// <summary>
 /// Checks if the <paramref name="username"/>exists in the data store.
 /// </summary>
 /// <param name="username">Username to check (string)</param>
 /// <returns>Returns true if the user exists and false if not.</returns>
 public static bool CheckUserExistence(string username)
 {
     // Call the check method via the User DAO with the username.
     return(_userDAO.CheckUserExistence(username));
 }