From da4fe41f3404e6f043aeea12d8b0212c098a76c4 Mon Sep 17 00:00:00 2001 From: David Sparer Date: Mon, 17 Oct 2016 09:24:40 -0600 Subject: [PATCH] Added extra test to cover setting the authenticator max attempts --- .../Authentication/PasswordAuthenticatorTests.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mRemoteNGTests/Security/Authentication/PasswordAuthenticatorTests.cs b/mRemoteNGTests/Security/Authentication/PasswordAuthenticatorTests.cs index 7db59b2f..d12bcee3 100644 --- a/mRemoteNGTests/Security/Authentication/PasswordAuthenticatorTests.cs +++ b/mRemoteNGTests/Security/Authentication/PasswordAuthenticatorTests.cs @@ -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); + } } } \ No newline at end of file