Exemplo n.º 1
0
        public void AuthenticateWithCode_ValidCode_ReturnsTrue()
        {
            securitySettings.RequireAccountVerification = false;
            var id = subject.CreateAccount("test", "pass", "*****@*****.**").ID;

            subject.ChangeMobilePhoneRequest(id, "123");
            var acct = subject.GetByID(id);

            subject.ChangeMobilePhoneFromCode(id, acct.MobileCode);
            subject.ConfigureTwoFactorAuthentication(acct.ID, TwoFactorAuthMode.Mobile);

            subject.Authenticate("test", "pass");

            acct = subject.GetByID(id);
            Assert.IsTrue(subject.AuthenticateWithCode(id, acct.MobileCode));
        }