示例#1
0
 public void ShouldCreateInsertStatementWithTable()
 {
     FlepperQueryBuilder.Insert().Into("Test")
     .Build()
     .Trim()
     .Should()
     .Be("INSERT INTO [Test]");
 }
示例#2
0
 public void ShouldCreateInsertStatementWithColumns()
 {
     FlepperQueryBuilder
     .Insert().Into("Test")
     .Columns("column1", "column2")
     .Build()
     .Trim()
     .Should()
     .Be("INSERT INTO [Test] ([column1],[column2] )");
 }
示例#3
0
        public void ShouldCreateInsertStatementWithValues()
        {
            var queryResult = FlepperQueryBuilder
                              .Insert().Into("Test")
                              .Values("value1", 2)
                              .BuildWithParameters();

            queryResult.Query
            .Trim()
            .Should()
            .Be("INSERT INTO [Test] VALUES (@p0, @p1)");

            dynamic parameters = queryResult.Parameters;

            Assert.Equal("value1", parameters.@p0);
            Assert.Equal(2, parameters.@p1);
        }