public void WhenCalled_SetsLastModified() { var lockout = new TimedLockout("key", lastModified: DateTimeOffset.UtcNow); var model = new TimedLockoutModel(lockout); Assert.Equal(lockout.LastModified, model.LastModified); }
public virtual async Task <TimedLockout> Update(TimedLockout lockout) { Guard.Null(nameof(lockout), lockout); var model = new TimedLockoutModel(lockout); await this.ModelStore.Update(model).ConfigureAwait(false); return(lockout); }
public void WhenCalled_SetsExpiration() { var lockout = new TimedLockout("key", lastModified: DateTimeOffset.UtcNow) { Expiration = DateTimeOffset.UtcNow }; var model = new TimedLockoutModel(lockout); Assert.Equal(lockout.Expiration, model.Expiration); }
public void WhenCalled_SetsFailedAccessAttempts() { var lockout = new TimedLockout("key", lastModified: DateTimeOffset.UtcNow) { FailedAccessAttempts = 5 }; var model = new TimedLockoutModel(lockout); Assert.Equal(5, model.FailedAccessAttempts); }