Ejemplo n.º 1
0
        public void DbPoolConnection_DbConnection_HasDefaultConnectionString()
        {
            DbPoolConnection connection = DbPoolConnection.getInstance(0);

            String defaultConnectionString = connection.getDatabaseConnection().getConnectionString();

            Assert.AreEqual(DbPoolConnection.defaultConnectionString, defaultConnectionString, "DefaultConnectionString not correct");
        }
Ejemplo n.º 2
0
        public void DbPoolConnection_GetDbConnection_ReturnsADbConnectionObject()
        {
            DbPoolConnection poolConnection = DbPoolConnection.getInstance(0);

            DbConnection connection = poolConnection.getDatabaseConnection();

            Assert.IsTrue(connection.GetType() == typeof(DbConnection), "Types doesn't match");
        }
Ejemplo n.º 3
0
        public void DbPoolConnection_GetInstance_WithNotExistingKey_ReturnsNewDbPoolConnection()
        {
            DbPoolConnection poolConnection;

            poolConnection = DbPoolConnection.getInstance(0);

            Assert.IsNotNull(poolConnection.getDatabaseConnection(), "DbConnection should not be null");
        }
Ejemplo n.º 4
0
        public void DbPoolConnectionl_GetInstance_ReturnsSameInstanceForSameKey()
        {
            DbPoolConnection poolConnectionOne, poolConnectionTwo;

            poolConnectionOne = DbPoolConnection.getInstance(0);
            poolConnectionTwo = DbPoolConnection.getInstance(0);

            Assert.AreSame(poolConnectionOne, poolConnectionTwo, "DbPoolConnection objects should be the same");
        }