示例#1
0
                public void WhenCalled_SetsLastModified()
                {
                    var lockout = new TimedLockout("key", lastModified: DateTimeOffset.UtcNow);

                    var model = new TimedLockoutModel(lockout);

                    Assert.Equal(lockout.LastModified, model.LastModified);
                }
示例#2
0
        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);
        }
示例#3
0
                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);
                }
示例#4
0
                public void WhenCalled_SetsFailedAccessAttempts()
                {
                    var lockout = new TimedLockout("key", lastModified: DateTimeOffset.UtcNow)
                    {
                        FailedAccessAttempts = 5
                    };

                    var model = new TimedLockoutModel(lockout);

                    Assert.Equal(5, model.FailedAccessAttempts);
                }