public void RemoteFacetedSearchHonorsConditionalGet() { using (var store = GetDocumentStore()) { Setup(store, _stronglyTypedFacets); string firstChangeVector; const string queryUrl = "/queries?query=FROM%20INDEX%20'CameraCost'%20WHERE%20Manufacturer%20=%20'canon'&facetDoc=facets%2FCameraFacets&facetStart=0&facetPageSize=&op=facets"; var url = string.Format(queryUrl, "canon"); Assert.Equal(HttpStatusCode.OK, ConditionalGetHelper.PerformGet(store, url, null, out firstChangeVector)); //second request should give 304 not modified Assert.Equal(HttpStatusCode.NotModified, ConditionalGetHelper.PerformGet(store, url, firstChangeVector, out firstChangeVector)); //change index etag by inserting new doc InsertCameraData(store, GetCameras(1)); string secondChangeVector; //changing the index should give 200 OK Assert.Equal(HttpStatusCode.OK, ConditionalGetHelper.PerformGet(store, url, firstChangeVector, out secondChangeVector)); //next request should give 304 not modified Assert.Equal(HttpStatusCode.NotModified, ConditionalGetHelper.PerformGet(store, url, secondChangeVector, out secondChangeVector)); } }
public void RemoteFacetedSearchHonorsConditionalGet() { using (var store = GetDocumentStore()) { Setup(store, _stronglyTypedFacets); long?firstEtag; var queryUrl = store.Url.ForDatabase(store.DefaultDatabase) + "/queries/CameraCost?facetDoc=facets%2FCameraFacets&query=Manufacturer%253A{0}&facetStart=0&facetPageSize=&op=facets"; var url = string.Format(queryUrl, "canon"); Assert.Equal(HttpStatusCode.OK, ConditionalGetHelper.PerformGet(store, url, null, out firstEtag)); //second request should give 304 not modified Assert.Equal(HttpStatusCode.NotModified, ConditionalGetHelper.PerformGet(store, url, firstEtag, out firstEtag)); //change index etag by inserting new doc InsertCameraData(store, GetCameras(1)); long?secondEtag; //changing the index should give 200 OK Assert.Equal(HttpStatusCode.OK, ConditionalGetHelper.PerformGet(store, url, firstEtag, out secondEtag)); //next request should give 304 not modified Assert.Equal(HttpStatusCode.NotModified, ConditionalGetHelper.PerformGet(store, url, secondEtag, out secondEtag)); } }