public void Cached_client_does_return_NotModified_when_MustRevalidate() { ClientCacheMaxAge.Count = 0; var request = new ClientCacheMustRevalidate { Id = 7, Value = "foo" }; var client = new CachedServiceClient(new JsonServiceClient(Config.ListeningOn)); ClientCacheMustRevalidate response; response = client.Get(request); Assert.That(ClientCacheMustRevalidate.Count, Is.EqualTo(1)); Assert.That(client.NotModifiedHits, Is.EqualTo(0)); AssertEquals(response, request); response = client.Get(request); Assert.That(ClientCacheMustRevalidate.Count, Is.EqualTo(1)); Assert.That(client.NotModifiedHits, Is.EqualTo(1)); AssertEquals(response, request); }
public object Any(ClientCacheMustRevalidate request) { Interlocked.Increment(ref ClientCacheMustRevalidate.Count); return(request); }