Example #1
0
        public async Task ResetLoginCounterByIpAddress_LoginCounterIsAccurate(string ipAddress)
        {
            // Arrange
            ILoginAttemptsRepository loginAttemptsRepository =
                new LoginAttemptsRepository(new SQLServerGateway(), new ConnectionStringData());

            // Act
            await loginAttemptsRepository.ResetLoginCounterByIpAddress(ipAddress);

            var newLoginAttempt = await loginAttemptsRepository.GetLoginAttemptsByIpAddress(ipAddress);

            // Assert
            Assert.IsTrue(newLoginAttempt.LoginCounter == 0);
        }