diff options
author | Guillaume Lacasa <guillaumelacasa@hotmail.com> | 2014-03-17 18:01:40 +0100 |
---|---|---|
committer | Guillaume Lacasa <guillaumelacasa@hotmail.com> | 2014-03-17 18:01:40 +0100 |
commit | 6f71d431c921e8b9aab0bbe89b3293671b81563e (patch) | |
tree | 108abd109f4dfe6744557711494ede9c81124867 /TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs | |
parent | 0d73b105daca5ccca439d0e04692d773c33d274a (diff) | |
download | TwoStepsAuthenticator-6f71d431c921e8b9aab0bbe89b3293671b81563e.zip TwoStepsAuthenticator-6f71d431c921e8b9aab0bbe89b3293671b81563e.tar.gz TwoStepsAuthenticator-6f71d431c921e8b9aab0bbe89b3293671b81563e.tar.bz2 |
The UsedCodeManager needs to have an user object, in order to avoid a user to block a temp code for every other usersv1.0
Diffstat (limited to 'TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs')
-rw-r--r-- | TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs b/TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs index 99d1957..8aacfe1 100644 --- a/TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs +++ b/TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs @@ -46,7 +46,7 @@ namespace TwoStepsAuthenticator.UnitTests public void Prevent_code_reuse() { var date = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); var usedCodesManager = new UsedCodesManager(); - var authenticator = new TimeAuthenticator(() => date, usedCodeManager: usedCodesManager); + var authenticator = new TimeAuthenticator(usedCodesManager, () => date); var secret = Authenticator.GenerateKey(); var code = authenticator.GetCode(secret); @@ -76,7 +76,7 @@ namespace TwoStepsAuthenticator.UnitTests DateTime usedTime; - Assert.True(authenticator.CheckCode("H22Q7WAMQYFZOJ2Q", "696227", out usedTime)); + Assert.True(authenticator.CheckCode("H22Q7WAMQYFZOJ2Q", "696227", null, out usedTime)); // 17:23:50 - 30s Assert.AreEqual(usedTime.Hour, 17); |