Beispiel #1
0
        public void UserManagementServiceUT_CheckIfIPLocked_IpIsDisabledSuccess(string ipAddress)
        {
            // Arrange: Insert Ip into ip table.
            bool lockResult = UserManagementServiceUT.CreateIP(ipAddress);

            Assert.IsTrue(lockResult);

            // Arrange: Attempt to faile to register 3 times.
            // IPs: Are only locked this way.
            for (int i = 0; i < 3; i++)
            {
                bool registerResult = UserManagementServiceUT.IncrementRegistrationFailures(ipAddress, Constants.RegistrationTriesResetTime, Constants.MaxRegistrationAttempts);
                Assert.IsTrue(registerResult);
            }


            // Act
            bool result = UserManagementServiceUT.CheckIfIPLocked(ipAddress);

            // Assert: Check that an IP that is inserted returns true.
            Assert.IsTrue(result);
        }