public static async Task AnalyseTables_GivenTableWithColumnNameContainingReservedKeyword_ProducesMessages()
        {
            var rule = new ReservedKeywordNameRule(CreateFakeDialect(), RuleLevel.Error);

            var testColumn = new DatabaseColumn(
                "SELECT",
                Mock.Of <IDbType>(),
                false,
                null,
                null
                );

            var table = new RelationalDatabaseTable(
                "test",
                new List <IDatabaseColumn> {
                testColumn
            },
                null,
                Array.Empty <IDatabaseKey>(),
                Array.Empty <IDatabaseRelationalKey>(),
                Array.Empty <IDatabaseRelationalKey>(),
                Array.Empty <IDatabaseIndex>(),
                Array.Empty <IDatabaseCheckConstraint>(),
                Array.Empty <IDatabaseTrigger>()
                );
            var tables = new[] { table };

            var hasMessages = await rule.AnalyseTables(tables).AnyAsync().ConfigureAwait(false);

            Assert.That(hasMessages, Is.True);
        }
        public static async Task AnalyseTables_GivenTableWithRegularName_ProducesNoMessages()
        {
            var rule      = new ReservedKeywordNameRule(CreateFakeDialect(), RuleLevel.Error);
            var tableName = new Identifier("test");

            var table = new RelationalDatabaseTable(
                tableName,
                new List <IDatabaseColumn>(),
                null,
                Array.Empty <IDatabaseKey>(),
                Array.Empty <IDatabaseRelationalKey>(),
                Array.Empty <IDatabaseRelationalKey>(),
                Array.Empty <IDatabaseIndex>(),
                Array.Empty <IDatabaseCheckConstraint>(),
                Array.Empty <IDatabaseTrigger>()
                );
            var tables = new[] { table };

            var hasMessages = await rule.AnalyseTables(tables).AnyAsync().ConfigureAwait(false);

            Assert.That(hasMessages, Is.False);
        }
        public static void AnalyseTables_GivenNullTables_ThrowsArgumentNullException()
        {
            var rule = new ReservedKeywordNameRule(CreateFakeDialect(), RuleLevel.Error);

            Assert.That(() => rule.AnalyseTables(null), Throws.ArgumentNullException);
        }