public void ShouldBeAbleToSetCustomExpiration() { var cachableTypeWithCustomExpiration = new CachableTypeWithCustomExpiration(); var cacheAttribute = EnableOutputCacheAttribute.GetServiceOutputCacheSettings(cachableTypeWithCustomExpiration.GetType()); Assert.AreEqual(20, cacheAttribute.ExpiresInSeconds); }
public void ShouldBeAbleToSetCustomCacheability() { var cachableTypeWithCustomCacheability = new CacheableTypeWithCustomHttpCacheability(); var cacheAttribute = EnableOutputCacheAttribute.GetServiceOutputCacheSettings(cachableTypeWithCustomCacheability.GetType()); Assert.AreEqual(HttpCacheability.Public, cacheAttribute.HttpCacheability); }
public void ShouldReturnNullWhenNoOutCacheAttributeIsPresent() { var nonCachableType = new NonCachableType(); var cacheAttribute = EnableOutputCacheAttribute.GetServiceOutputCacheSettings(nonCachableType.GetType()); Assert.IsNull(cacheAttribute); }
public void ShouldDefaultExpirationTo30SecondsAndDefaultHttpCacheabilityToServerAndPrivate() { var cachableType = new CachableType(); var cacheAttribute = EnableOutputCacheAttribute.GetServiceOutputCacheSettings(cachableType.GetType()); Assert.AreEqual(30, cacheAttribute.ExpiresInSeconds); Assert.AreEqual(HttpCacheability.ServerAndPrivate, cacheAttribute.HttpCacheability); }