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

                    var model = new TimedLockoutModel(lockout);

                    Assert.Equal(lockout.LastModified.ToOffset(), model.LastModified);
                }
예제 #2
0
                public void WhenCalled_SetsExpiration()
                {
                    var lockout = new TimedLockout("key",
                                                   lastModified: new UtcDateTime(DateTimeOffset.UtcNow))
                    {
                        Expiration = new UtcDateTime(DateTimeOffset.UtcNow)
                    };

                    var model = new TimedLockoutModel(lockout);

                    Assert.Equal(lockout.Expiration.ToOffset(), model.Expiration);
                }
예제 #3
0
                public void WhenCalled_SetsFailedAccessAttempts()
                {
                    var lockout = new TimedLockout("key",
                                                   lastModified: new UtcDateTime(DateTimeOffset.UtcNow))
                    {
                        FailedAccessAttempts = 5
                    };

                    var model = new TimedLockoutModel(lockout);

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