Beispiel #1
0
 public bool Equals(TimeToLive other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(other._validFor.Equals(_validFor) &&
            other._expiresAt.Equals(_expiresAt) &&
            other._neverExpires.Equals(_neverExpires) &&
            other._isAbsoluteTime.Equals(_isAbsoluteTime));
 }
Beispiel #2
0
 private void item_is_stored_in_cache_sucessfully(string key, object value, TimeToLive timeToLive)
 {
     memcachedClient.Setup(mc => mc.Store(GetStoreMode(), key, value, timeToLive)).Returns(true).Verifiable();
 }
Beispiel #3
0
 public when_time_to_live_is_set_to_be_valid_for_a_specific_period_of_time()
 {
     Given(() => timeToLive = TimeToLive.CreateValidFor(validFor));
 }
Beispiel #4
0
 public when_time_to_live_is_set_as_never_expiring()
 {
     Given(() => timeToLive = TimeToLive.CreateNeverExpiring());
 }
Beispiel #5
0
 public when_time_to_live_is_set_to_expire_at_specific_moment()
 {
     Given(() => timeToLive = TimeToLive.CreateExpiringAt(expiringAt));
 }
Beispiel #6
0
 public bool Equals(TimeToLive other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return other._validFor.Equals(_validFor)
         && other._expiresAt.Equals(_expiresAt)
         && other._neverExpires.Equals(_neverExpires)
         && other._isAbsoluteTime.Equals(_isAbsoluteTime);
 }