Пример #1
0
        public void ThrowExceptionOnSqlStatementBuilderCreateTruncateIfTheTableIsWhitespace()
        {
            // Setup
            var statementBuilder = new SqlStatementBuilder();
            var queryBuilder     = new QueryBuilder();
            var tableName        = " ";

            // Act
            statementBuilder.CreateTruncate(queryBuilder: queryBuilder,
                                            tableName: tableName);
        }
Пример #2
0
        public void ThrowExceptionOnSqlStatementBuilderCreateTruncateIfTheTableIsNull()
        {
            // Setup
            var statementBuilder = new SqlStatementBuilder();
            var queryBuilder     = new QueryBuilder();
            var tableName        = (string)null;

            // Act
            statementBuilder.CreateTruncate(queryBuilder: queryBuilder,
                                            tableName: tableName);
        }
Пример #3
0
        public void TestWithClassMappings()
        {
            // Setup
            var statementBuilder = new SqlStatementBuilder();
            var queryBuilder     = new QueryBuilder <TestWithClassMappingsClass>();

            // Act
            var actual   = statementBuilder.CreateTruncate(queryBuilder);
            var expected = $"" +
                           $"TRUNCATE TABLE [ClassName] ;";

            // Assert
            Assert.AreEqual(expected, actual);
        }
Пример #4
0
        public void TestSqlStatementBuilderCreateTruncate()
        {
            // Setup
            var statementBuilder = new SqlStatementBuilder();
            var queryBuilder     = new QueryBuilder();
            var tableName        = "Table";

            // Act
            var actual = statementBuilder.CreateTruncate(queryBuilder: queryBuilder,
                                                         tableName: tableName);
            var expected = "TRUNCATE TABLE [Table] ;";

            // Assert
            Assert.AreEqual(expected, actual);
        }