BetterMembership.IntegrationTests.ExtendedMembershipProvider.IsAccountLockedOutTests.GivenConfirmedUserWhenMoreThanMaxNumberOfPasswordAttemptsAndWaitLongerThanPasswordTimeoutThenAccountIsNotLockedOut C# (CSharp) Method

GivenConfirmedUserWhenMoreThanMaxNumberOfPasswordAttemptsAndWaitLongerThanPasswordTimeoutThenAccountIsNotLockedOut() private method

            GivenConfirmedUserWhenMoreThanMaxNumberOfPasswordAttemptsAndWaitLongerThanPasswordTimeoutThenAccountIsNotLockedOut
            (string providerName)
        {
            // arrange
            const int PasswordAttemptWindowInSeconds = 1;
            var testClass = this.WithExtendedProvider(providerName);
            var testUser =
                testClass.WithConfirmedUser()
                         .WithInvalidPasswordAttempts(testClass.MaxInvalidPasswordAttempts + 1)
                         .Value;

            // act
            Thread.Sleep((PasswordAttemptWindowInSeconds * 1000) + 500);
            var webSecurityIsLockedOut = testClass.IsAccountLockedOut(
                testUser.UserName, testClass.MaxInvalidPasswordAttempts, PasswordAttemptWindowInSeconds);

            // assert
            Assert.That(webSecurityIsLockedOut, Is.False);
        }