Beispiel #1
0
        public static void GetTable_GivenNullTableName_ThrowsArgNullException()
        {
            var connection         = Mock.Of <ISchematicConnection>();
            var identifierDefaults = Mock.Of <IIdentifierDefaults>();

            var tableProvider = new MySqlRelationalDatabaseTableProvider(connection, identifierDefaults);

            Assert.That(() => tableProvider.GetTable(null), Throws.ArgumentNullException);
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MySqlRelationalDatabase"/> class.
        /// </summary>
        /// <param name="connection">A database connection.</param>
        /// <param name="identifierDefaults">Identifier defaults for the associated database.</param>
        /// <exception cref="ArgumentNullException"><paramref name="connection"/> is <c>null</c> or <paramref name="identifierDefaults"/> is <c>null</c>.</exception>
        public MySqlRelationalDatabase(ISchematicConnection connection, IIdentifierDefaults identifierDefaults)
        {
            if (connection == null)
            {
                throw new ArgumentNullException(nameof(connection));
            }

            IdentifierDefaults = identifierDefaults ?? throw new ArgumentNullException(nameof(identifierDefaults));

            _tableProvider   = new MySqlRelationalDatabaseTableProvider(connection, identifierDefaults);
            _viewProvider    = new MySqlDatabaseViewProvider(connection, identifierDefaults);
            _routineProvider = new MySqlDatabaseRoutineProvider(connection, identifierDefaults);
        }