public void ShouldGetInstanceOfSqlDataReader()
        {
            var dataReader = new Mock<IDataReader>().Object;
            var sqlDatabaseReader = new SqlDatabaseReaderFactory().CreateDataReader(dataReader);

            Assert.IsInstanceOf<SqlDatabaseReader>(sqlDatabaseReader);
        }
Exemplo n.º 2
0
 public IDatabaseSession CreateSession(string connectionString)
 {
     var sqlConnectionProvider = _connectionProvider ?? new SqlConnectionProvider(connectionString);
     var transactionWrapper = new TransactionWrapper(sqlConnectionProvider);
     var databaseConnectionManager = new DatabaseCommandProvider(sqlConnectionProvider, transactionWrapper);
     var databaseCommandCreator = new DatabaseCommandFactory(databaseConnectionManager);
     var databaseReaderFactory = new SqlDatabaseReaderFactory();
     var connectionHandler = new ConnectionHandler();
     return new DatabaseSession(databaseCommandCreator, transactionWrapper, databaseReaderFactory, connectionHandler);
 }