コード例 #1
0
        public void Cached_DynamoQuery_does_cached_duplicate_requests_when_MaxAge_Custom_Cached()
        {
            var request = new CustomQueryCacheMaxAgeDataRockstars();
            var client  = new CachedServiceClient(new JsonServiceClient(Config.ListeningOn));

            var response = client.Get(request);

            Assert.That(client.CacheHits, Is.EqualTo(0));
            Assert.That(response.Results.Count, Is.EqualTo(Rockstars.Count));

            response = client.Get(request);
            Assert.That(client.CacheHits, Is.EqualTo(1));
            Assert.That(response.Results.Count, Is.EqualTo(Rockstars.Count));

            response = client.Get(new CustomQueryCacheMaxAgeDataRockstars {
                Age = 27
            });
            Assert.That(client.CacheHits, Is.EqualTo(1));
            Assert.That(response.Results.Count, Is.EqualTo(Rockstars.Count(x => x.Age == 27)));
        }
コード例 #2
0
 public object Any(CustomQueryCacheMaxAgeDataRockstars query)
 {
     return(AutoQuery.Execute(query, AutoQuery.CreateQuery(query, Request)));
 }