public QueryCachingTests() { _connection = new Mock <AtsConnection>(); _connection .Setup(s => s.ExecuteRequest(It.IsAny <TableRequest <bool> >(), It.IsAny <ILogger>())) .Returns(false); // keep all requests in memory var configuration = new Mock <DbContextConfiguration>(); configuration.SetupGet(s => s.Connection).Returns(_connection.Object); configuration.SetupGet(s => s.Model).Returns(CreateModel()); configuration.SetupGet(s => s.LoggerFactory).Returns(new LoggerFactory()); configuration.SetupGet(s => s.StateManager).Returns(new Mock <StateManager>().Object); configuration.SetupGet(s => s.Services.EntityKeyFactorySource).Returns(new Mock <EntityKeyFactorySource>().Object); configuration.SetupGet(s => s.Services.StateEntryFactory).Returns(new Mock <StateEntryFactory>().Object); configuration.SetupGet(s => s.Services.EntityMaterializerSource).Returns(new Mock <EntityMaterializerSource>().Object); configuration.SetupGet(s => s.Services.ClrCollectionAccessorSource).Returns(new Mock <ClrCollectionAccessorSource>().Object); configuration.SetupGet(s => s.Services.ClrPropertySetterSource).Returns(new Mock <ClrPropertySetterSource>().Object); _dataStore = new AtsDataStore( configuration.Object, _connection.Object, new AtsQueryFactory(new AtsValueReaderFactory()), new TableEntityAdapterFactory()); }
public QueryCachingTests() { _connection = new Mock <AtsConnection>(); _connection .Setup(s => s.ExecuteRequest(It.IsAny <TableRequest <bool> >(), It.IsAny <ILogger>())) .Returns(false); // keep all requests in memory var configuration = new Mock <DbContextConfiguration>(); configuration.SetupGet(s => s.Connection).Returns(_connection.Object); configuration.SetupGet(s => s.Model).Returns(CreateModel()); configuration.SetupGet(s => s.LoggerFactory).Returns(new NullLoggerFactory()); _dataStore = new AtsDataStore( configuration.Object, _connection.Object, new AtsQueryFactory(new AtsValueReaderFactory()), new TableEntityAdapterFactory()); }
public AtsDataStoreServices( [NotNull] AtsDataStore store, [NotNull] AtsDataStoreCreator creator, [NotNull] AtsConnection connection, [NotNull] AtsValueGeneratorCache valueGeneratorCache, [NotNull] AtsDatabase database, [NotNull] AtsModelBuilderFactory 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; }