public void Ensure_creation_async()
        {
            var model = Mock.Of<IModel>();
            var configurationMock = new Mock<DbContextConfiguration>();

            var creator = new RedisDataStoreCreator(configurationMock.Object);
            Assert.False(creator.EnsureCreatedAsync(model).Result);
        }
Exemple #2
0
        public void Ensure_creation_async()
        {
            var model             = Mock.Of <IModel>();
            var configurationMock = new Mock <DbContextConfiguration>();

            var creator = new RedisDataStoreCreator(configurationMock.Object);

            Assert.False(creator.EnsureCreatedAsync(model).Result);
        }
        public void Ensure_deletion_async()
        {
            var model = Mock.Of<IModel>();
            var configurationMock = new Mock<DbContextConfiguration>();
            var databaseMock = new Mock<RedisDatabase>(configurationMock.Object);
            configurationMock.SetupGet(m => m.Database).Returns(databaseMock.Object);

            var creator = new RedisDataStoreCreator(configurationMock.Object);
            Assert.True(creator.EnsureDeletedAsync(model).Result);
            databaseMock.Verify(m => m.FlushDatabaseAsync(CancellationToken.None), Times.Once);
        }
Exemple #4
0
        public void Ensure_deletion_async()
        {
            var model             = Mock.Of <IModel>();
            var configurationMock = new Mock <DbContextConfiguration>();
            var databaseMock      = new Mock <RedisDatabase>(configurationMock.Object);

            configurationMock.SetupGet(m => m.Database).Returns(databaseMock.Object);

            var creator = new RedisDataStoreCreator(configurationMock.Object);

            Assert.True(creator.EnsureDeletedAsync(model).Result);
            databaseMock.Verify(m => m.FlushDatabaseAsync(CancellationToken.None), Times.Once);
        }
Exemple #5
0
        public RedisDataStoreServices(
            [NotNull] RedisDataStore store,
            [NotNull] RedisDataStoreCreator creator,
            [NotNull] RedisConnection connection,
            [NotNull] ValueGeneratorCache valueGeneratorCache,
            [NotNull] RedisDatabase database,
            [NotNull] ModelBuilderFactory modelBuilderFactory)
        {
            Check.NotNull(store, "store");
            Check.NotNull(creator, "creator");
            Check.NotNull(connection, "connection");
            Check.NotNull(valueGeneratorCache, "valueGeneratorCache");
            Check.NotNull(database, "database");
            Check.NotNull(modelBuilderFactory, "modelBuilderFactory");

            _store               = store;
            _creator             = creator;
            _connection          = connection;
            _valueGeneratorCache = valueGeneratorCache;
            _database            = database;
            _modelBuilderFactory = modelBuilderFactory;
        }
        public RedisDataStoreServices(
            [NotNull] RedisDataStore store,
            [NotNull] RedisDataStoreCreator creator,
            [NotNull] RedisConnection connection,
            [NotNull] ValueGeneratorCache valueGeneratorCache,
            [NotNull] RedisDatabase database,
            [NotNull] ModelBuilderFactory modelBuilderFactory)
        {
            Check.NotNull(store, "store");
            Check.NotNull(creator, "creator");
            Check.NotNull(connection, "connection");
            Check.NotNull(valueGeneratorCache, "valueGeneratorCache");
            Check.NotNull(database, "database");
            Check.NotNull(modelBuilderFactory, "modelBuilderFactory");

            _store = store;
            _creator = creator;
            _connection = connection;
            _valueGeneratorCache = valueGeneratorCache;
            _database = database;
            _modelBuilderFactory = modelBuilderFactory;
        }