Inheritance: DefaultDatabase, IDatabase
        public void Constructor_should_set_provider_and_connectionstring()
        {
            IDataProvider dataProvider = new Mock<IDataProvider>().Object;
            Database db = new Database(dataProvider, "foo");

            Assert.AreEqual("foo", db.ConnectionString);
            Assert.AreEqual(dataProvider, db.Provider);
        }
        public void SetUp()
        {
            _dialect = new Mock<Dialect>();
            _provider = new Mock<IDataProvider>();
            _connection = new Mock<IDbConnection>();
            _transaction = new Mock<IDbTransaction>();
            _cmd = new Mock<IDbCommand>();
            _parameter1 = new Mock<IDbDataParameter>();
            _parameter2 = new Mock<IDbDataParameter>();
            _parameter1.SetupAllProperties();
            _parameter2.SetupAllProperties();

            _allParameters = new DataParameterCollectionFake();

            _connection.Setup(p => p.BeginTransaction()).Returns(_transaction.Object);
            _connection.Setup(p => p.CreateCommand()).Returns(_cmd.Object);
            _provider.Setup(p => p.GetConnection()).Returns(_connection.Object);
            _provider.Setup(p => p.GetParameter())
                .Returns(() => _parameter1.Object)
                .Callback(() => _provider.Setup(p => p.GetParameter())
                                         .Returns(_parameter2.Object));

            _provider.Setup(p => p.GetParameter(It.IsAny<In>(), false)).Returns(() => _parameter1.Object)
                                  .Callback(() => _provider.Setup(p => p.GetParameter())
                                  .Returns(_parameter2.Object));

            _cmd.SetupGet(p => p.Parameters).Returns(_allParameters);

            _db = new Database(_provider.Object, "");
        }