summaryrefslogtreecommitdiffstats
path: root/TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs
diff options
context:
space:
mode:
authorDavid Thornley <david.thornley@touchstargroup.com>2015-06-24 16:44:39 +1000
committerDavid Thornley <david.thornley@touchstargroup.com>2015-06-24 16:44:39 +1000
commitdc22815ee75be7f81bd1506d745601e08cc21d48 (patch)
treebb62881ff6d8ce3b34feb6f2bf6c57895b9e9546 /TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs
parent5d4afd15454dcb6fca15622d55be5889029ecbfe (diff)
downloadTwoStepsAuthenticator-dc22815ee75be7f81bd1506d745601e08cc21d48.zip
TwoStepsAuthenticator-dc22815ee75be7f81bd1506d745601e08cc21d48.tar.gz
TwoStepsAuthenticator-dc22815ee75be7f81bd1506d745601e08cc21d48.tar.bz2
* Fixes for unit tests
- Prevent_code_reuse() - requires a dummy user for UsedCodesManager to detect reuse. - VerifyUsedTime() - parsed date is GMT+1 resultant usedTime.Hour assertion was 3am in GMT+10 (just patched it to run correctly here, by comparing against date fed to nowDate lambda).
Diffstat (limited to 'TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs')
-rw-r--r--TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs b/TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs
index 8aacfe1..0c385fa 100644
--- a/TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs
+++ b/TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs
@@ -50,8 +50,8 @@ namespace TwoStepsAuthenticator.UnitTests
var secret = Authenticator.GenerateKey();
var code = authenticator.GetCode(secret);
- Assert.IsTrue(authenticator.CheckCode(secret, code));
- Assert.IsFalse(authenticator.CheckCode(secret, code));
+ Assert.IsTrue(authenticator.CheckCode(secret, code, "dummyuser"));
+ Assert.IsFalse(authenticator.CheckCode(secret, code, "dummyuser"));
}
// Test Vectors from http://tools.ietf.org/html/rfc6238#appendix-B have all length 8. We want a length of 6.
@@ -79,7 +79,7 @@ namespace TwoStepsAuthenticator.UnitTests
Assert.True(authenticator.CheckCode("H22Q7WAMQYFZOJ2Q", "696227", null, out usedTime));
// 17:23:50 - 30s
- Assert.AreEqual(usedTime.Hour, 17);
+ Assert.AreEqual(usedTime.Hour, date.Hour);
Assert.AreEqual(usedTime.Minute, 23);
Assert.AreEqual(usedTime.Second, 20);
}