示例#1
0
        public void Failure_Integer_ShouldReturnSuccessFalseWithContentAsDefaultInt()
        {
            var result = CacheResult <int> .Failure();

            result.Success.ShouldBeFalse();
            result.Content.ShouldBe(default(int));
        }
示例#2
0
        private static CacheResult <TResult> CreateCacheResult <TResult>(string entry)
        {
            if (entry == null)
            {
                return(CacheResult <TResult> .Failure());
            }

            return(new CacheResult <TResult>
            {
                Success = true,
                Content = JsonConvert.DeserializeObject <TResult>(entry)
            });
        }