Example #1
0
        public InsertDbCommandBuilder(
            TableDefinition tableDefinition,
            IInsertedColumnsSpecification insertedColumnsSpecification,
            ISqlDialect sqlDialect)
            : base(sqlDialect)
        {
            ArgumentUtility.CheckNotNull("tableDefinition", tableDefinition);
            ArgumentUtility.CheckNotNull("insertedColumnsSpecification", insertedColumnsSpecification);

            _tableDefinition = tableDefinition;
            _insertedColumnsSpecification = insertedColumnsSpecification;
        }
Example #2
0
        public override void SetUp()
        {
            base.SetUp();

            _insertedColumnsSpecificationStub = MockRepository.GenerateStub <IInsertedColumnsSpecification>();

            _sqlDialectStub = MockRepository.GenerateStub <ISqlDialect> ();
            _sqlDialectStub.Stub(stub => stub.StatementDelimiter).Return(";");

            _dbDataParameterStub         = MockRepository.GenerateStub <IDbDataParameter> ();
            _dataParameterCollectionMock = MockRepository.GenerateStrictMock <IDataParameterCollection> ();

            _dbCommandStub = MockRepository.GenerateStub <IDbCommand> ();
            _dbCommandStub.Stub(stub => stub.CreateParameter()).Return(_dbDataParameterStub);
            _dbCommandStub.Stub(stub => stub.Parameters).Return(_dataParameterCollectionMock);

            _commandExecutionContextStub = MockRepository.GenerateStub <IRdbmsProviderCommandExecutionContext> ();
            _commandExecutionContextStub.Stub(stub => stub.CreateDbCommand()).Return(_dbCommandStub);
        }