public void GetIAVSCDatabaseByNoneDatabaseType()
 {
     Assert.Throws <NotSupportedDatabaseException>(() =>
                                                   AVSCDatabaseFactory.GetIAVSCDatabase(
                                                       DatabaseType.None,
                                                       connectionString: string.Empty
                                                       )
                                                   );
 }
        public void GetIDbConnectionByConfigurationSuccess()
        {
            var databaseSettingsSection
                = GetDatabaseSettings("DatabaseSettings");

            var iDbConnection
                = AVSCDatabaseFactory.GetIDbConnection(databaseSettingsSection);

            iDbConnection.GetType().Should().Be(typeof(MySqlConnection));
        }
        public void GetIAVSCDatabaseByConfigurationSuccess()
        {
            var databaseSettingsSection
                = GetDatabaseSettings("DatabaseSettings");

            var avscDatabase
                = AVSCDatabaseFactory.GetIAVSCDatabase(databaseSettingsSection);

            avscDatabase.GeneratorId.Should().Be("MySql");
        }
 public void GetIAVSCDatabaseByParametersAndNoneDatabaseType()
 {
     Assert.Throws <NotSupportedDatabaseException>(() =>
                                                   AVSCDatabaseFactory.GetIAVSCDatabase(
                                                       DatabaseType.None,
                                                       serverName: string.Empty,
                                                       username: string.Empty,
                                                       password: string.Empty,
                                                       databaseName: string.Empty
                                                       )
                                                   );
 }
        public void GetIDbConnectionByDatabaseTypeAndConnectionStringSuccess
        (
            DatabaseType databaseType,
            string connectionString,
            Type expectedDatabaseType
        )
        {
            var iDbConnection = AVSCDatabaseFactory.GetIDbConnection(
                databaseType,
                connectionString
                );

            iDbConnection.GetType().Should().Be(expectedDatabaseType);
        }
        public void GetIAVSCDatabaseByDatabaseType
        (
            DatabaseType databaseType,
            string expectedGeneratorId,
            string connectionString,
            Type expectedDatabaseType
        )
        {
            var avscDatabase = AVSCDatabaseFactory.GetIAVSCDatabase(
                databaseType, connectionString);

            avscDatabase.GeneratorId.Should().Be(expectedGeneratorId);
            var iDbConnection = avscDatabase.GetDbConnection();

            iDbConnection.GetType().Should().Be(expectedDatabaseType);
        }
        public void GetIDbConnectionByParametersSuccess
        (
            DatabaseType databaseType,
            string serverName,
            Type expectedDatabaseType
        )
        {
            var iDbConnection = AVSCDatabaseFactory.GetIDbConnection(
                databaseType,
                serverName,
                username: string.Empty,
                password: string.Empty,
                databaseName: string.Empty
                );

            iDbConnection.GetType().Should().Be(expectedDatabaseType);
        }
        public void GetIAVSCDatabaseByParametersSuccess
        (
            DatabaseType databaseType,
            string expectedGeneratorId,
            string serverName,
            Type expectedDatabaseType
        )
        {
            var avscDatabase = AVSCDatabaseFactory.GetIAVSCDatabase(
                databaseType,
                serverName,
                username: string.Empty,
                password: string.Empty,
                databaseName: string.Empty
                );

            avscDatabase.GeneratorId.Should().Be(expectedGeneratorId);
            var iDbConnection = avscDatabase.GetDbConnection();

            iDbConnection.GetType().Should().Be(expectedDatabaseType);
        }
        public void GetInMemoryIDbConnectionSuccess()
        {
            var iDbConnection = AVSCDatabaseFactory.GetInMemoryIDbConnection();

            iDbConnection.Should().BeOfType <SQLiteConnection>();
        }
        public void GetIAVSCInMemoryDatabaseSuccess()
        {
            var db = AVSCDatabaseFactory.GetIAVSCInMemoryDatabase();

            db.GeneratorId.Should().Be("Sqlite");
        }