예제 #1
0
 public void TestUserExists_NotExists()
 {
     Assert.IsFalse(ledger.UserExists("testUser"));
 }
예제 #2
0
        // Prompts the user from stdin to create a new account
        private static void CreateAccount(Services.BankLedger ledger)
        {
            Console.WriteLine();
            Console.WriteLine($"Enter your desired username (or \"{EXIT_KEYWORD}\" to return to the main menu):");
            var username = Console.ReadLine();

            // verifying account doesn't already exist with given username
            while (!username.Equals(EXIT_KEYWORD, StringComparison.OrdinalIgnoreCase) && ledger.UserExists(username))
            {
                Console.WriteLine($"Username {username} is already taken. Please enter a different username:"******"Enter your desired password:"******"Re-enter your password:"******"The passwords you entered did not match. Please try again.");
                    Console.WriteLine("Enter your desired password:"******"Re-enter your password:"******"Account successfully created! Please log in.");
                Console.WriteLine();
            }
        }