Added extra test to cover setting the authenticator max attempts

This commit is contained in:
David Sparer
2016-10-17 09:24:40 -06:00
parent 91fe4050b2
commit da4fe41f34

View File

@@ -95,5 +95,20 @@ namespace mRemoteNGTests.Security.Authentication
_authenticator.Authenticate(_wrongPassword);
Assert.That(authAttempts == _authenticator.MaxAttempts);
}
[Test]
public void AuthenticatorRespectsMaxAttemptsCustomValue()
{
const int customMaxAttempts = 5;
_authenticator.MaxAttempts = customMaxAttempts;
var authAttempts = 0;
_authenticator.AuthenticationRequestor = () =>
{
authAttempts++;
return _wrongPassword;
};
_authenticator.Authenticate(_wrongPassword);
Assert.That(authAttempts == customMaxAttempts);
}
}
}