Ejemplo n.º 1
0
 public SimulatedAccounts(IpPool ipPool, SimulatedPasswords simPasswords, DebugLogger logger)
 {
     _ipPool       = ipPool;
     _logger       = logger;
     _simPasswords = simPasswords;
 }
Ejemplo n.º 2
0
        public async Task RunAsync(DebugLogger _logger, IpPool _ipPool)
        {
            TestConfiguration configuration = InitTest();

            _logger.WriteStatus("   "); _logger.WriteStatus("   "); _logger.WriteStatus("   ");


            _logger.WriteStatus("01)--------------------------------------------------------------------------");
            _logger.WriteStatus("Test With Correct User Account");
            CreateTestAccount(configuration, Username1, Password1);
            for (int i = 0; i < 1; i++)
            {
                LoginAttempt attempt = await AuthenticateAsync(configuration, Username1, Password1, Ip1);

                _logger.WriteStatus("Result - " + attempt.Outcome);
            }
            _logger.WriteStatus("-----------------------------------------------------------------------------");

            _logger.WriteStatus("   ");
            _logger.WriteStatus("02)--------------------------------------------------------------------------");
            _logger.WriteStatus("Test With Correct User Account with multiple login attempts ");
            string[] usernames = CreateUserAccounts(configuration, 200);
            foreach (string username in usernames.Skip(10))
            {
                await AuthenticateAsync(configuration, username, Password1, clientAddress : Ip1);
            }
            for (int i = 0; i < 1; i++)
            {
                LoginAttempt attempt = await AuthenticateAsync(configuration, Username1, Password1, Ip1);

                _logger.WriteStatus("Result - " + attempt.Outcome);
            }
            _logger.WriteStatus("-----------------------------------------------------------------------------");

            _logger.WriteStatus("   ");
            _logger.WriteStatus("03)--------------------------------------------------------------------------");
            _logger.WriteStatus("Test With InCorrect Username ");
            for (int i = 0; i < 1; i++)
            {
                LoginAttempt attempt = await AuthenticateAsync(configuration, "Invalid Account", Password1, Ip2, cookieProvidedByBrowser : "GimmeCookie");

                _logger.WriteStatus("Result - " + attempt.Outcome);
            }
            _logger.WriteStatus("-----------------------------------------------------------------------------");

            _logger.WriteStatus("   ");
            _logger.WriteStatus("04)--------------------------------------------------------------------------");
            _logger.WriteStatus("Test With InCorrect Username Multiple Attempts ");
            for (int i = 0; i < 1; i++)
            {
                LoginAttempt attempt = await AuthenticateAsync(configuration, "Invalid Account", Password1, Ip2, cookieProvidedByBrowser : "GimmeCookie");

                _logger.WriteStatus("Result - " + attempt.Outcome);
            }
            _logger.WriteStatus("-----------------------------------------------------------------------------");

            _logger.WriteStatus("   ");
            _logger.WriteStatus("05)--------------------------------------------------------------------------");
            _logger.WriteStatus("Test With InCorrect Password ");
            for (int i = 0; i < 1; i++)
            {
                LoginAttempt attempt = await AuthenticateAsync(configuration, Username1, "Incorrect Password", Ip3, cookieProvidedByBrowser : "GimmeCookie");

                _logger.WriteStatus("Result - " + attempt.Outcome);
            }
            _logger.WriteStatus("-----------------------------------------------------------------------------");

            _logger.WriteStatus("   ");
            _logger.WriteStatus("06)--------------------------------------------------------------------------");
            _logger.WriteStatus("Test With InCorrect Password Multiple Attempts ");
            for (int i = 0; i < 1; i++)
            {
                LoginAttempt attempt = await AuthenticateAsync(configuration, Username1, "Incorrect Password", Ip3, cookieProvidedByBrowser : "GimmeCookie");

                _logger.WriteStatus("Result - " + attempt.Outcome);
            }
            _logger.WriteStatus("-----------------------------------------------------------------------------");
        }