public void Create_WithCustomSchema() { var tableDefinition = TableDefinitionObjectMother.Create( TestDomainStorageProviderDefinition, new EntityNameDefinition("customSchema", "Table")); var builder = new DeleteDbCommandBuilder( tableDefinition, _comparedColumnsSpecificationStrictMock, _sqlDialectStub); _sqlDialectStub.Expect(mock => mock.DelimitIdentifier("Table")).Return("[delimited Table]"); _sqlDialectStub.Expect(mock => mock.DelimitIdentifier("customSchema")).Return("[delimited customSchema]"); _comparedColumnsSpecificationStrictMock.Expect(stub => stub.AddParameters(_dbCommandStub, _sqlDialectStub)); _comparedColumnsSpecificationStrictMock .Expect( stub => stub.AppendComparisons( Arg <StringBuilder> .Is.Anything, Arg.Is(_dbCommandStub), Arg.Is(_sqlDialectStub))) .WhenCalled(mi => ((StringBuilder)mi.Arguments[0]).Append("[ID] = @ID")); _comparedColumnsSpecificationStrictMock.Replay(); var result = builder.Create(_commandExecutionContextStub); _comparedColumnsSpecificationStrictMock.VerifyAllExpectations(); Assert.That(result.CommandText, Is.EqualTo("DELETE FROM [delimited customSchema].[delimited Table] WHERE [ID] = @ID;")); }