예제 #1
0
        public async Task Should_Exclude_Last_Segment_Of_The_Uri_From_The_Key_Cache()
        {
            var region93 = await _geoApi2.GetRegion("93");

            byte[] cassetteA = await _cache2.GetAsync(KeyGetRegionWithLastSegmentExcluded);

            cassetteA.Should().NotBeNull("The cassette should have been cached without the last segment in the key.");

            var region44 = await _geoApi2.GetRegion("44");

            byte[] cassetteB = await _cache2.GetAsync(KeyGetRegionWithLastSegmentExcluded);

            cassetteB.Should().NotBeNull("The cassette should already be in the cache due to the ExcludeLastUriSegment HTTP header.");
            region44.Should().BeEquivalentTo(region93, "What ever the given region code, the response should be region93 because [ExcludeLastUriSegment] is used.");
        }
예제 #2
0
 public async Task <ActionResult <Region> > GetRegion(string code)
 {
     return(await _geoApi.GetRegion(code));
 }