コード例 #1
0
        public void ShouldGenerateRightCodeEightDigits()
        {
            Totp totp = new Totp(secret, new StaticClock(), Digits.Eight);

            string now = totp.now();

            Assert.AreEqual("83002941", now);
            totp.verify(now);
        }
コード例 #2
0
        public void ShouldGenerateRightCodeOneDigit()
        {
            Totp totp = new Totp(secret, new StaticClock(), Digits.One);

            string now = totp.now();

            Assert.AreEqual("1", now);
            totp.verify(now);
        }