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)); }
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(); }
public when_time_to_live_is_set_to_be_valid_for_a_specific_period_of_time() { Given(() => timeToLive = TimeToLive.CreateValidFor(validFor)); }
public when_time_to_live_is_set_as_never_expiring() { Given(() => timeToLive = TimeToLive.CreateNeverExpiring()); }
public when_time_to_live_is_set_to_expire_at_specific_moment() { Given(() => timeToLive = TimeToLive.CreateExpiringAt(expiringAt)); }
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); }