Exemple #1
0
        public void TestBadParameters()
        {
            var factory = new DatabaseConnectionFactory();

            Assert.ThrowsException <ArgumentNullException>(() => factory.CreateConnection(null, default));
            Assert.ThrowsException <ArgumentOutOfRangeException>(() => factory.CreateConnection(String.Empty, (DatabaseType)42));
        }
Exemple #2
0
        public void TestWorks()
        {
            var factory = new DatabaseConnectionFactory();

            Assert.IsInstanceOfType(factory.CreateConnection(String.Empty, DatabaseType.MariaDB), typeof(MySqlConnection));
            Assert.IsInstanceOfType(factory.CreateConnection(String.Empty, DatabaseType.MySql), typeof(MySqlConnection));
            Assert.IsInstanceOfType(factory.CreateConnection(String.Empty, DatabaseType.SqlServer), typeof(SqlConnection));
        }