示例#1
0
        public void ThrowExceptionOnSqlStatementBuilderCreateDeleteAllIfTheTableIsWhitespace()
        {
            // Setup
            var statementBuilder = new SqlStatementBuilder();
            var queryBuilder     = new QueryBuilder();
            var tableName        = " ";

            // Act
            statementBuilder.CreateDeleteAll(queryBuilder: queryBuilder,
                                             tableName: tableName);
        }
示例#2
0
        public void TestWithMappings()
        {
            // Setup
            var statementBuilder = new SqlStatementBuilder();
            var queryBuilder     = new QueryBuilder <TestWithMappingsClass>();

            // Act
            var actual   = statementBuilder.CreateDeleteAll(queryBuilder);
            var expected = $"" +
                           $"DELETE " +
                           $"FROM [ClassName] ;";

            // Assert
            Assert.AreEqual(expected, actual);
        }
示例#3
0
        public void TestSqlStatementBuilderCreateDeleteAll()
        {
            // Setup
            var statementBuilder = new SqlStatementBuilder();
            var queryBuilder     = new QueryBuilder();
            var tableName        = "Table";

            // Act
            var actual = statementBuilder.CreateDeleteAll(queryBuilder: queryBuilder,
                                                          tableName: tableName);
            var expected = "DELETE FROM [Table] ;";

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