HasExpired() 공개 메소드

public HasExpired ( ) : bool
리턴 bool
예제 #1
0
 public void Should_expire_after_One_second()
 {
     var log = MockRepository.GenerateMock<ILog>();
     var t = new TimeSpan(0, 0, 0, 0, 500);
     var cache = new Cache(t, log);
     cache.ResetCache();
     Assert.That(cache.HasExpired(), Is.EqualTo(false));
     Thread.Sleep(1000);
     Assert.That(cache.HasExpired(), Is.EqualTo(true));
 }
예제 #2
0
 public void Should_expire_after_construction()
 {
     var log = MockRepository.GenerateMock<ILog>();
     var t = new TimeSpan(0, 0, 0, 0, 500);
     var cache = new Cache(t, log);
     Assert.That(cache.HasExpired(), Is.EqualTo(true));
 }