Ejemplo n.º 1
0
        public void TestMethod1()
        {
            string secret    = TwoFactor.GenerateRandomSecret();
            var    twoFactor = new TwoFactor(secret);

            string x = twoFactor.GenerateCode();

            Assert.AreEqual(x.Length, 6);

            Assert.IsTrue(twoFactor.ValidateCode(x) && !twoFactor.ValidateCode("000000"));
        }