public void Too_Late_Returns_False() { // Arrange var key = Rnd.ByteF.Get(8); var interval = TotpF.GetCurrentInterval(30) - 1; var code = TotpF.GenerateCode(key, interval, 6); // Act var result = TotpF.VerifyCode(key, code, TotpSettings.Default with { IntervalTolerance = false });
public void Incorrect_Key_Returns_False() { // Arrange var key = Rnd.ByteF.Get(8); var code = TotpF.GenerateCode(key, TotpSettings.Default); // Act var result = TotpF.VerifyCode(Rnd.ByteF.Get(8), code, TotpSettings.Default); // Assert Assert.False(result); }