public void Getting_unsupported_asynchronous_cache_returns_null()
        {
            var fakeCacheManager = Substitute.For <ICacheProvider>();

            fakeCacheManager
            .IsAsynchronousSupported
            .Returns(false);

            ICacheResolver cacheResolver = new DefaultCacheResolver(fakeCacheManager, Substitute.For <ILogger>());

            var cache = cacheResolver.GetAsyncCache(typeof(IAccount));

            cache.ShouldBeNull();
        }
        public void Getting_asynchronous_cache()
        {
            var fakeCacheManager = Substitute.For <IAsynchronousCacheProvider>();

            fakeCacheManager
            .IsAsynchronousSupported
            .Returns(true);
            fakeCacheManager
            .GetAsyncCache(Arg.Any <string>())
            .Returns(_ =>
            {
                return(Substitute.For <IAsynchronousCache>());
            });

            ICacheResolver cacheResolver = new DefaultCacheResolver(fakeCacheManager, Substitute.For <ILogger>());

            var cache = cacheResolver.GetAsyncCache(typeof(IAccount));

            cache.ShouldBeAssignableTo <IAsynchronousCache>();
        }