public void Get_ReturnsNullWhenItemInvalidated() { CachingService cachingService = new CachingService(); cachingService.Put("abc", "response", TimeSpan.FromSeconds(0)); string response = cachingService.Get("abc") as string; Assert.Null(response); }
public void Put_ResponseCached() { CachingService cachingService = new CachingService(); cachingService.Put("abc", "response", TimeSpan.FromSeconds(10)); string response = cachingService.Get("abc") as string; Assert.Equal("response", response); }
public void Put_NullResponseNotCached() { CachingService cachingService = new CachingService(); cachingService.Put("abc", null, TimeSpan.FromSeconds(10)); string response = cachingService.Get("abc") as string; Assert.Null(response); }