summaryrefslogtreecommitdiffstats
path: root/TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs
diff options
context:
space:
mode:
authorChristoph Enzmann <christoph.enzmann@confer.ch>2013-12-05 17:47:33 +0100
committerChristoph Enzmann <christoph.enzmann@confer.ch>2013-12-05 17:47:33 +0100
commit3e3f949d007812349c623da09f539ab465d46b50 (patch)
tree99563a436dc76c982acc0cf13fa027a08a5a7f5a /TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs
parent9b8c9cc8bafa315516b6ac704859c6d13ce1b768 (diff)
downloadTwoStepsAuthenticator-3e3f949d007812349c623da09f539ab465d46b50.zip
TwoStepsAuthenticator-3e3f949d007812349c623da09f539ab465d46b50.tar.gz
TwoStepsAuthenticator-3e3f949d007812349c623da09f539ab465d46b50.tar.bz2
Methods for synchronization
Diffstat (limited to 'TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs')
-rw-r--r--TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs b/TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs
index 3d19ea2..3dc6d86 100644
--- a/TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs
+++ b/TwoStepsAuthenticator.UnitTests/TimeAuthenticatorTests.cs
@@ -30,5 +30,20 @@ namespace TwoStepsAuthenticator.UnitTests {
Assert.IsTrue(authenticator.CheckCode(secret, code));
}
+
+ [Test]
+ public void VerifyUsedTime() {
+ var date = DateTime.Parse("2013-12-05 17:23:50 +0100");
+ var authenticator = new TimeAuthenticator(() => date);
+
+ DateTime usedTime;
+
+ Assert.True(authenticator.CheckCode("H22Q7WAMQYFZOJ2Q", "696227", out usedTime));
+
+ // 17:23:50 - 30s
+ Assert.AreEqual(usedTime.Hour, 17);
+ Assert.AreEqual(usedTime.Minute, 23);
+ Assert.AreEqual(usedTime.Second, 20);
+ }
}
}