public void SetUp() { _storageTypeInformationProviderStub = MockRepository.GenerateStub <IStorageTypeInformationProvider> (); _dataReaderStrictMock = MockRepository.GenerateStrictMock <IDataReader>(); _queryResultRowReader = new QueryResultRowReader(_storageTypeInformationProviderStub); }
protected virtual IStorageProviderCommandFactory <IRdbmsProviderCommandExecutionContext> CreateStorageProviderCommandFactory( RdbmsProviderDefinition storageProviderDefinition, IStorageTypeInformationProvider storageTypeInformationProvider, IStorageNameProvider storageNameProvider, IRdbmsPersistenceModelProvider persistenceModelProvider, IInfrastructureStoragePropertyDefinitionProvider infrastructureStoragePropertyDefinitionProvider, IDataStoragePropertyDefinitionFactory dataStoragePropertyDefinitionFactory) { ArgumentUtility.CheckNotNull("storageProviderDefinition", storageProviderDefinition); ArgumentUtility.CheckNotNull("storageNameProvider", storageNameProvider); ArgumentUtility.CheckNotNull("persistenceModelProvider", persistenceModelProvider); ArgumentUtility.CheckNotNull("infrastructureStoragePropertyDefinitionProvider", infrastructureStoragePropertyDefinitionProvider); ArgumentUtility.CheckNotNull("storageTypeInformationProvider", storageTypeInformationProvider); ArgumentUtility.CheckNotNull("dataStoragePropertyDefinitionFactory", dataStoragePropertyDefinitionFactory); var dataContainerValidator = CreateDataContainerValidator(storageProviderDefinition); var objectReaderFactory = new ObjectReaderFactory( persistenceModelProvider, infrastructureStoragePropertyDefinitionProvider, storageTypeInformationProvider, dataContainerValidator); var dbCommandBuilderFactory = CreateDbCommandBuilderFactory(storageProviderDefinition); return(new RdbmsProviderCommandFactory( storageProviderDefinition, dbCommandBuilderFactory, persistenceModelProvider, objectReaderFactory, new TableDefinitionFinder(persistenceModelProvider), dataStoragePropertyDefinitionFactory)); }
public override void SetUp() { base.SetUp(); _storageTypeInformationProviderStub = MockRepository.GenerateStub <IStorageTypeInformationProvider> (); _idStorageTypeInformation = StorageTypeInformationObjectMother.CreateStorageTypeInformation(); _storageTypeInformationProviderStub .Stub(stub => stub.GetStorageTypeForID(false)) .Return(_idStorageTypeInformation); _classIDStorageTypeInformation = StorageTypeInformationObjectMother.CreateStorageTypeInformation(); _storageTypeInformationProviderStub .Stub(stub => stub.GetStorageTypeForClassID(false)) .Return(_classIDStorageTypeInformation); _timestampStorageTypeInformation = StorageTypeInformationObjectMother.CreateStorageTypeInformation(); _storageTypeInformationProviderStub .Stub(stub => stub.GetStorageTypeForTimestamp(false)) .Return(_timestampStorageTypeInformation); _storageNameProviderStub = MockRepository.GenerateStub <IStorageNameProvider>(); _storageNameProviderStub.Stub(stub => stub.GetIDColumnName()).Return("ID"); _storageNameProviderStub.Stub(stub => stub.GetClassIDColumnName()).Return("ClassID"); _storageNameProviderStub.Stub(stub => stub.GetTimestampColumnName()).Return("Timestamp"); _infrastructureStoragePropertyDefinitionProvider = new InfrastructureStoragePropertyDefinitionProvider(_storageTypeInformationProviderStub, _storageNameProviderStub); }
public InfrastructureStoragePropertyDefinitionProvider( IStorageTypeInformationProvider storageTypeInformationProvider, IStorageNameProvider storageNameProvider) { ArgumentUtility.CheckNotNull("storageTypeInformationProvider", storageTypeInformationProvider); ArgumentUtility.CheckNotNull("storageNameProvider", storageNameProvider); _idColumnDefinition = new ColumnDefinition( storageNameProvider.GetIDColumnName(), storageTypeInformationProvider.GetStorageTypeForID(false), true); _classIDColumnDefinition = new ColumnDefinition( storageNameProvider.GetClassIDColumnName(), storageTypeInformationProvider.GetStorageTypeForClassID(false), false); _timestampColumnDefinition = new ColumnDefinition( storageNameProvider.GetTimestampColumnName(), storageTypeInformationProvider.GetStorageTypeForTimestamp(false), false); _objectIDStoragePropertyDefinition = new ObjectIDStoragePropertyDefinition( new SimpleStoragePropertyDefinition(typeof(object), _idColumnDefinition), new SimpleStoragePropertyDefinition(typeof(string), _classIDColumnDefinition)); _timestampStoragePropertyDefinition = new SimpleStoragePropertyDefinition(typeof(object), _timestampColumnDefinition); }
public void SetUp() { _storageTypeInformationProviderStub = MockRepository.GenerateStub <IStorageTypeInformationProvider>(); _storageTypeInformationStub = MockRepository.GenerateStub <IStorageTypeInformation>(); _scalarValue = "5"; _queryResultRowAdapter = new ScalarResultRowAdapter(_scalarValue, _storageTypeInformationProviderStub); }
public ScalarResultRowAdapter(object scalarValue, IStorageTypeInformationProvider storageTypeInformationProvider) { ArgumentUtility.CheckNotNull("scalarValue", scalarValue); ArgumentUtility.CheckNotNull("storageTypeInformationProvider", storageTypeInformationProvider); _scalarValue = scalarValue; _storageTypeInformationProvider = storageTypeInformationProvider; }
public QueryResultRow(IDataReader dataReader, IStorageTypeInformationProvider storageTypeInformationProvider) { ArgumentUtility.CheckNotNull("dataReader", dataReader); ArgumentUtility.CheckNotNull("storageTypeInformationProvider", storageTypeInformationProvider); _dataReader = dataReader; _storageTypeInformationProvider = storageTypeInformationProvider; }
public ValueStoragePropertyDefinitionFactory( IStorageTypeInformationProvider storageTypeInformationProvider, IStorageNameProvider storageNameProvider) { ArgumentUtility.CheckNotNull("storageTypeInformationProvider", storageTypeInformationProvider); ArgumentUtility.CheckNotNull("storageNameProvider", storageNameProvider); _storageTypeInformationProvider = storageTypeInformationProvider; _storageNameProvider = storageNameProvider; }
protected virtual IValueStoragePropertyDefinitionFactory CreateValueStoragePropertyDefinitionFactory( RdbmsProviderDefinition storageProviderDefinition, IStorageTypeInformationProvider storageTypeInformationProvider, IStorageNameProvider storageNameProvider) { ArgumentUtility.CheckNotNull("storageProviderDefinition", storageProviderDefinition); ArgumentUtility.CheckNotNull("storageNameProvider", storageNameProvider); ArgumentUtility.CheckNotNull("storageTypeInformationProvider", storageTypeInformationProvider); return(new ValueStoragePropertyDefinitionFactory(storageTypeInformationProvider, storageNameProvider)); }
protected virtual IInfrastructureStoragePropertyDefinitionProvider CreateInfrastructureStoragePropertyDefinitionProvider( RdbmsProviderDefinition storageProviderDefinition, IStorageTypeInformationProvider storageTypeInformationProvider, IStorageNameProvider storageNameProvider) { ArgumentUtility.CheckNotNull("storageProviderDefinition", storageProviderDefinition); ArgumentUtility.CheckNotNull("storageTypeInformationProvider", storageTypeInformationProvider); ArgumentUtility.CheckNotNull("storageNameProvider", storageNameProvider); return(new InfrastructureStoragePropertyDefinitionProvider(storageTypeInformationProvider, storageNameProvider)); }
public override void SetUp() { base.SetUp(); _storageNameProviderMock = MockRepository.GenerateStrictMock <IStorageNameProvider>(); _storageProviderDefinitionFinderStub = MockRepository.GenerateStub <IStorageProviderDefinitionFinder>(); _storageTypeInformationProviderStrictMock = MockRepository.GenerateStrictMock <IStorageTypeInformationProvider> (); _factory = new RelationStoragePropertyDefinitionFactory(TestDomainStorageProviderDefinition, false, _storageNameProviderMock, _storageTypeInformationProviderStrictMock, _storageProviderDefinitionFinderStub); _fakeStorageTypeInformation1 = StorageTypeInformationObjectMother.CreateStorageTypeInformation(); _fakeStorageTypeInformation2 = StorageTypeInformationObjectMother.CreateStorageTypeInformation(); }
public TestableSqlStorageObjectFactory(IRdbmsPersistenceModelProvider rdbmsPersistenceModelProvider, IStorageTypeInformationProvider storageTypeInformationProvider, IDbCommandBuilderFactory dbCommandBuilderFactory, IStorageNameProvider storageNameProvider, IInfrastructureStoragePropertyDefinitionProvider infrastructureStoragePropertyDefinitionProvider, IDataStoragePropertyDefinitionFactory dataStoragePropertyDefinitionFactory, IValueStoragePropertyDefinitionFactory valueStoragePropertyDefinitionFactory, IRelationStoragePropertyDefinitionFactory relationStoragePropertyDefinitionFactory, ISqlQueryGenerator sqlQueryGenerator, IForeignKeyConstraintDefinitionFactory foreignKeyConstraintDefinitionFactoryFactory, IStoragePropertyDefinitionResolver storagePropertyDefinitionResolver) { _infrastructureStoragePropertyDefinitionProvider = infrastructureStoragePropertyDefinitionProvider; _storageNameProvider = storageNameProvider; _dbCommandBuilderFactory = dbCommandBuilderFactory; _storageTypeInformationProvider = storageTypeInformationProvider; _rdbmsPersistenceModelProvider = rdbmsPersistenceModelProvider; _dataStoragePropertyDefinitionFactory = dataStoragePropertyDefinitionFactory; _valueStoragePropertyDefinitionFactory = valueStoragePropertyDefinitionFactory; _relationStoragePropertyDefinitionFactory = relationStoragePropertyDefinitionFactory; _sqlQueryGenerator = sqlQueryGenerator; _foreignKeyConstraintDefinitionFactory = foreignKeyConstraintDefinitionFactoryFactory; _storagePropertyDefinitionResolver = storagePropertyDefinitionResolver; }
public DomainObjectQueryGenerator( ISqlQueryGenerator sqlQueryGenerator, ITypeConversionProvider typeConversionProvider, IStorageTypeInformationProvider storageTypeInformationProvider, IMappingConfiguration mappingConfiguration) { ArgumentUtility.CheckNotNull("sqlQueryGenerator", sqlQueryGenerator); ArgumentUtility.CheckNotNull("typeConversionProvider", typeConversionProvider); ArgumentUtility.CheckNotNull("storageTypeInformationProvider", storageTypeInformationProvider); ArgumentUtility.CheckNotNull("mappingConfiguration", mappingConfiguration); _sqlQueryGenerator = sqlQueryGenerator; _typeConversionProvider = typeConversionProvider; _storageTypeInformationProvider = storageTypeInformationProvider; _mappingConfiguration = mappingConfiguration; }
public void SetUp() { _storageTypeInformationProviderMock = MockRepository.GenerateStrictMock <IStorageTypeInformationProvider> (); _storageNameProviderStub = MockRepository.GenerateStub <IStorageNameProvider>(); _factory = new ValueStoragePropertyDefinitionFactory(_storageTypeInformationProviderMock, _storageNameProviderStub); _someClassDefinition = ClassDefinitionObjectMother.CreateClassDefinition(); _someClassDefinitionWithoutBaseClass = ClassDefinitionObjectMother.CreateClassDefinition(); _someClassDefinitionWithBaseClass = ClassDefinitionObjectMother.CreateClassDefinition(id: "some", baseClass: _someClassDefinitionWithoutBaseClass); _someClassDefinitionWithBaseBaseClass = ClassDefinitionObjectMother.CreateClassDefinition(id: "some", baseClass: _someClassDefinitionWithBaseClass); _fakeStorageTypeInformation1 = StorageTypeInformationObjectMother.CreateStorageTypeInformation(); _fakeStorageTypeInformation2 = StorageTypeInformationObjectMother.CreateStorageTypeInformation(); }
public override void SetUp() { base.SetUp(); _sqlQueryGeneratorMock = MockRepository.GenerateStrictMock <ISqlQueryGenerator> (); _typeConversionProvider = SafeServiceLocator.Current.GetInstance <ITypeConversionProvider>(); _storageTypeInformationProviderStub = MockRepository.GenerateStub <IStorageTypeInformationProvider>(); _generator = new DomainObjectQueryGenerator( _sqlQueryGeneratorMock, _typeConversionProvider, _storageTypeInformationProviderStub, Configuration); _customerClassDefinition = GetTypeDefinition(typeof(Customer)); _customerQueryModel = QueryModelObjectMother.Create(Expression.Constant(null, typeof(Customer))); }
public void SetUp() { _rdbmsProviderDefinition = new RdbmsProviderDefinition("TestDomain", new SqlStorageObjectFactory(), "ConnectionString"); _sqlProviderFactory = new SqlStorageObjectFactory(); _persistenceExtensionStub = MockRepository.GenerateStub <IPersistenceExtension>(); _storageProviderDefinitionFinder = new StorageGroupBasedStorageProviderDefinitionFinder(DomainObjectsConfiguration.Current.Storage); _tableBuilderStub = MockRepository.GenerateStub <TableScriptBuilder> ( MockRepository.GenerateStub <ITableScriptElementFactory>(), new SqlCommentScriptElementFactory()); _viewBuilderStub = MockRepository.GenerateStub <ViewScriptBuilder> ( MockRepository.GenerateStub <IViewScriptElementFactory <TableDefinition> >(), MockRepository.GenerateStub <IViewScriptElementFactory <UnionViewDefinition> >(), MockRepository.GenerateStub <IViewScriptElementFactory <FilterViewDefinition> >(), MockRepository.GenerateStub <IViewScriptElementFactory <EmptyViewDefinition> >(), new SqlCommentScriptElementFactory()); _constraintBuilderStub = MockRepository.GenerateStub <ForeignKeyConstraintScriptBuilder> ( MockRepository.GenerateStub <IForeignKeyConstraintScriptElementFactory>(), new SqlCommentScriptElementFactory()); _indexScriptElementFactoryStub = MockRepository.GenerateStub <SqlIndexScriptElementFactory> ( MockRepository.GenerateStub <ISqlIndexDefinitionScriptElementFactory <SqlIndexDefinition> >(), MockRepository.GenerateStub <ISqlIndexDefinitionScriptElementFactory <SqlPrimaryXmlIndexDefinition> >(), MockRepository.GenerateStub <ISqlIndexDefinitionScriptElementFactory <SqlSecondaryXmlIndexDefinition> >()); _indexBuilderStub = MockRepository.GenerateStub <IndexScriptBuilder> (_indexScriptElementFactoryStub, new SqlCommentScriptElementFactory()); _synonymBuilderStub = MockRepository.GenerateStub <SynonymScriptBuilder> ( MockRepository.GenerateStub <ISynonymScriptElementFactory <TableDefinition> >(), MockRepository.GenerateStub <ISynonymScriptElementFactory <UnionViewDefinition> >(), MockRepository.GenerateStub <ISynonymScriptElementFactory <FilterViewDefinition> >(), MockRepository.GenerateStub <ISynonymScriptElementFactory <EmptyViewDefinition> >(), new SqlCommentScriptElementFactory()); _rdbmsPersistenceModelProviderStub = MockRepository.GenerateStub <IRdbmsPersistenceModelProvider>(); _storageTypeInformationProviderStub = MockRepository.GenerateStub <IStorageTypeInformationProvider>(); _dbCommandBuilderFactoryStub = MockRepository.GenerateStub <IDbCommandBuilderFactory>(); MockRepository.GeneratePartialMock <SqlSynonymScriptElementFactory>(); _storageNameProviderStub = MockRepository.GenerateStub <IStorageNameProvider>(); _infrastructureStoragePropertyDefinitionProviderStub = MockRepository.GenerateStub <IInfrastructureStoragePropertyDefinitionProvider>(); _dataStoragePropertyDefinitionFactoryStub = MockRepository.GenerateStub <IDataStoragePropertyDefinitionFactory>(); _valueStoragePropertyDefinitonFactoryStub = MockRepository.GenerateStub <IValueStoragePropertyDefinitionFactory>(); _relationStoragePropertyDefiniitonFactoryStub = MockRepository.GenerateStub <IRelationStoragePropertyDefinitionFactory>(); _methodCallTransformerProviderStub = MockRepository.GenerateStub <IMethodCallTransformerProvider>(); _resultOpertatorHandlerRegistryStub = MockRepository.GeneratePartialMock <ResultOperatorHandlerRegistry>(); _sqlQueryGeneratorStub = MockRepository.GenerateStub <ISqlQueryGenerator>(); _foreignKeyConstraintDefinitionFactoryStub = MockRepository.GenerateStub <IForeignKeyConstraintDefinitionFactory>(); _storagePropertyDefinitionResolverStub = MockRepository.GenerateStub <IStoragePropertyDefinitionResolver>(); }
protected virtual IRelationStoragePropertyDefinitionFactory CreateRelationStoragePropertyDefinitionFactory( RdbmsProviderDefinition storageProviderDefinition, IStorageTypeInformationProvider storageTypeInformationProvider, IStorageNameProvider storageNameProvider, IStorageProviderDefinitionFinder providerDefinitionFinder) { ArgumentUtility.CheckNotNull("storageProviderDefinition", storageProviderDefinition); ArgumentUtility.CheckNotNull("storageNameProvider", storageNameProvider); ArgumentUtility.CheckNotNull("providerDefinitionFinder", providerDefinitionFinder); ArgumentUtility.CheckNotNull("storageTypeInformationProvider", storageTypeInformationProvider); return(new RelationStoragePropertyDefinitionFactory( storageProviderDefinition, false, storageNameProvider, storageTypeInformationProvider, providerDefinitionFinder)); }
public RelationStoragePropertyDefinitionFactory( StorageProviderDefinition storageProviderDefinition, bool forceClassIDColumnInForeignKeyProperties, IStorageNameProvider storageNameProvider, IStorageTypeInformationProvider storageTypeInformationProvider, IStorageProviderDefinitionFinder providerDefinitionFinder) { ArgumentUtility.CheckNotNull("storageProviderDefinition", storageProviderDefinition); ArgumentUtility.CheckNotNull("storageNameProvider", storageNameProvider); ArgumentUtility.CheckNotNull("storageTypeInformationProvider", storageTypeInformationProvider); ArgumentUtility.CheckNotNull("providerDefinitionFinder", providerDefinitionFinder); _storageProviderDefinition = storageProviderDefinition; _forceClassIDColumnInForeignKeyProperties = forceClassIDColumnInForeignKeyProperties; _storageNameProvider = storageNameProvider; _storageTypeInformationProvider = storageTypeInformationProvider; _providerDefinitionFinder = providerDefinitionFinder; }
protected virtual IDataStoragePropertyDefinitionFactory CreateDataStoragePropertyDefinitionFactory( RdbmsProviderDefinition storageProviderDefinition, IStorageTypeInformationProvider storageTypeInformationProvider, IStorageNameProvider storageNameProvider, IStorageProviderDefinitionFinder providerDefinitionFinder) { ArgumentUtility.CheckNotNull("storageProviderDefinition", storageProviderDefinition); ArgumentUtility.CheckNotNull("storageNameProvider", storageNameProvider); ArgumentUtility.CheckNotNull("providerDefinitionFinder", providerDefinitionFinder); ArgumentUtility.CheckNotNull("storageTypeInformationProvider", storageTypeInformationProvider); var valueStoragePropertyDefinitionFactory = CreateValueStoragePropertyDefinitionFactory( storageProviderDefinition, storageTypeInformationProvider, storageNameProvider); var relationStoragePropertyDefinitionFactory = CreateRelationStoragePropertyDefinitionFactory( storageProviderDefinition, storageTypeInformationProvider, storageNameProvider, providerDefinitionFinder); return(new DataStoragePropertyDefinitionFactory(valueStoragePropertyDefinitionFactory, relationStoragePropertyDefinitionFactory)); }
public override void SetUp() { base.SetUp(); _rdbmsPersistenceModelProviderStub = MockRepository.GenerateStub <IRdbmsPersistenceModelProvider>(); _entityDefinitionStub = MockRepository.GenerateStub <IRdbmsStorageEntityDefinition>(); _storageTypeInformationProviderStub = MockRepository.GenerateStub <IStorageTypeInformationProvider>(); _dataContainerValidatorStub = MockRepository.GenerateStub <IDataContainerValidator>(); _objectIDProperty = ObjectIDStoragePropertyDefinitionObjectMother.ObjectIDProperty; _timestampProperty = SimpleStoragePropertyDefinitionObjectMother.TimestampProperty; _entityDefinitionStub.Stub(stub => stub.ObjectIDProperty).Return(_objectIDProperty); _entityDefinitionStub.Stub(stub => stub.TimestampProperty).Return(_timestampProperty); _column1 = ColumnDefinitionObjectMother.CreateColumn("Column1"); _column2 = ColumnDefinitionObjectMother.CreateColumn("Column2"); _infrastructureStoragePropertyDefinitionProviderStub = MockRepository.GenerateStrictMock <IInfrastructureStoragePropertyDefinitionProvider> (); _factory = new ObjectReaderFactory( _rdbmsPersistenceModelProviderStub, _infrastructureStoragePropertyDefinitionProviderStub, _storageTypeInformationProviderStub, _dataContainerValidatorStub); }
protected override IRelationStoragePropertyDefinitionFactory CreateRelationStoragePropertyDefinitionFactory(RdbmsProviderDefinition storageProviderDefinition, IStorageTypeInformationProvider storageTypeInformationProvider, IStorageNameProvider storageNameProvider, IStorageProviderDefinitionFinder providerDefinitionFinder) { return(_relationStoragePropertyDefinitionFactory ?? base.CreateRelationStoragePropertyDefinitionFactory(storageProviderDefinition, storageTypeInformationProvider, storageNameProvider, providerDefinitionFinder)); }
protected override IValueStoragePropertyDefinitionFactory CreateValueStoragePropertyDefinitionFactory(RdbmsProviderDefinition storageProviderDefinition, IStorageTypeInformationProvider storageTypeInformationProvider, IStorageNameProvider storageNameProvider) { return(_valueStoragePropertyDefinitionFactory ?? base.CreateValueStoragePropertyDefinitionFactory(storageProviderDefinition, storageTypeInformationProvider, storageNameProvider)); }
protected override IInfrastructureStoragePropertyDefinitionProvider CreateInfrastructureStoragePropertyDefinitionProvider(RdbmsProviderDefinition storageProviderDefinition, IStorageTypeInformationProvider storageTypeInformationProvider, IStorageNameProvider storageNameProvider) { return(_infrastructureStoragePropertyDefinitionProvider ?? base.CreateInfrastructureStoragePropertyDefinitionProvider(storageProviderDefinition, storageTypeInformationProvider, storageNameProvider)); }
public QueryResultRowReader(IStorageTypeInformationProvider storageTypeInformationProvider) { ArgumentUtility.CheckNotNull("storageTypeInformationProvider", storageTypeInformationProvider); _storageTypeInformationProvider = storageTypeInformationProvider; }