예제 #1
0
        private static CouchbaseCache GetCache(TimeSpan?timeSpan = null)
        {
            var options = new CouchbaseCacheOptions
            {
                LifeSpan = timeSpan
            };

            var provider = new Mock <ICouchbaseCacheBucketProvider>();

            provider.Setup(x => x.GetBucket()).Returns(ClusterHelper.GetBucket("default"));

            return(new CouchbaseCache(provider.Object, options));
        }
        private CouchbaseCache GetCache(TimeSpan?timeSpan = null)
        {
            var options = new CouchbaseCacheOptions
            {
                LifeSpan = timeSpan
            };

            var provider = new Mock <ICouchbaseCacheCollectionProvider>();

            provider
            .Setup(x => x.GetCollectionAsync())
            .Returns(() => new ValueTask <ICouchbaseCollection>(_fixture.GetDefaultCollectionAsync()));

            return(new CouchbaseCache(provider.Object, options));
        }
예제 #3
0
 public FauxCouchbaseCache()
 {
     Options = new CouchbaseCacheOptions();
     Bucket  = new FauxBucket();
 }