public static void Init(TestContext context)
        {
            IConfiguration configurationProvider = CreateConfigurationProvider();
            ICosmosFactory cosmosfactory         = new CosmosFactory(configurationProvider);

            // creating a fake instance of cosmos so as to be able to asset the invocations using fakeiteasy
            // note: this is fake instance and does not hold a reference to the actual cosmos DB
            _cosmosRepository = A.Fake <ICosmosRepository>();
            IRedisCacheFactory redisCacheFactory = new RedisCacheFactory(configurationProvider);

            _redisRepository     = new RedisRepository(redisCacheFactory);
            _readThroughStrategy = A.Fake <ReadThroughStrategy>(x =>
                                                                x.WithArgumentsForConstructor(new Object[] { _redisRepository, _cosmosRepository }));
        }
Beispiel #2
0
 public WriteThroughCache(IWriteThroughStrategy writeStrategy, IReadThroughStrategy readStrategy)
 {
     _writeStrategy = writeStrategy;
     _readStrategy  = readStrategy;
 }