summaryrefslogtreecommitdiffstats
path: root/TwoStepsAuthenticator.UnitTests/AuthenticatorTests.cs
diff options
context:
space:
mode:
authorGuillaume Lacasa <guillaume.lacasa@ucaya.com>2013-12-06 15:32:54 +0100
committerGuillaume Lacasa <guillaume.lacasa@ucaya.com>2013-12-06 15:32:54 +0100
commit50beaba8291c1e777d5a63bb19400a260712f837 (patch)
tree46b14ab6b93d813e9f40aae760f4b3902e380800 /TwoStepsAuthenticator.UnitTests/AuthenticatorTests.cs
parent33c70541ca1e0ea27ac6a9ba5bbee799f03f9de8 (diff)
parent41cb13ee263104981850a73d4abf4a583df31941 (diff)
downloadTwoStepsAuthenticator-50beaba8291c1e777d5a63bb19400a260712f837.zip
TwoStepsAuthenticator-50beaba8291c1e777d5a63bb19400a260712f837.tar.gz
TwoStepsAuthenticator-50beaba8291c1e777d5a63bb19400a260712f837.tar.bz2
Merge branch 'master' of https://github.com/dusk0r/TwoStepsAuthenticator
Diffstat (limited to 'TwoStepsAuthenticator.UnitTests/AuthenticatorTests.cs')
-rw-r--r--TwoStepsAuthenticator.UnitTests/AuthenticatorTests.cs34
1 files changed, 0 insertions, 34 deletions
diff --git a/TwoStepsAuthenticator.UnitTests/AuthenticatorTests.cs b/TwoStepsAuthenticator.UnitTests/AuthenticatorTests.cs
deleted file mode 100644
index 5c250b8..0000000
--- a/TwoStepsAuthenticator.UnitTests/AuthenticatorTests.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using NUnit.Framework;
-
-namespace TwoStepsAuthenticator.UnitTests {
-
- [TestFixture]
- public class AuthenticatorTests {
-
- [Test]
- public void CreateKey() {
- var authenticator = new Authenticator();
- var secret = authenticator.GenerateKey();
- var code = authenticator.GetCode(secret);
-
- Assert.IsTrue(authenticator.CheckCode(secret, code), "Generated Code doesn't verify");
- }
-
- // Test Vectors from http://tools.ietf.org/html/rfc6238#appendix-B have all length 8. We want a length of 6.
- // This Test Vectors are from a Ruby implementation. They work with the Google Authentificator app.
- [TestCase("DRMK64PPMMC7TDZF", "2013-12-04 18:33:01 +0100", "661188")]
- [TestCase("EQOGSM3XZUH6SE2Y", "2013-12-04 18:34:56 +0100", "256804")]
- [TestCase("4VU7EQACVDMFJSBG", "2013-12-04 18:36:16 +0100", "800872")]
- public void VerifyKeys(string secret, string timeString, string code) {
- var date = DateTime.Parse(timeString);
-
- var authenticator = new Authenticator(() => date);
- Assert.IsTrue(authenticator.CheckCode(secret, code));
-
- }
- }
-}