public CachePolicyProviderTests() { this.response = new HttpResponseMessage(); this.response.Content = new StringContent("Hello"); this.policy = new CachePolicy(); this.provider = new CachePolicyProvider(this.policy); }
/// <summary> /// Initializes a new instance of the <see cref="CachePolicyProvider"/> class with the given <paramref name="policy"/>. /// </summary> /// <param name="policy">The <see cref="CachePolicy"/> to use if no HTTP caching response headers have been set on /// an <see cref="HttpResponseMessage"/>.</param> public CachePolicyProvider(CachePolicy policy) { if (policy == null) { throw new ArgumentNullException("policy"); } this.Policy = policy; }
public void Policy_Roundtrips() { CachePolicy roundtrip = new CachePolicy(); PropertyAssert.Roundtrips(this.provider, p => p.Policy, PropertySetter.NullRoundtrips, defaultValue: this.policy, roundtripValue: roundtrip); }
public CachePolicyTests() { this.policy = new CachePolicy(); }