コード例 #1
0
        public void CanAddCaseSensitiveColumnNames()
        {
            var expression = new InsertDataExpression();

             var builder = new InsertDataExpressionBuilder(expression);
             builder.WithCaseSensitiveColumnNames();

             expression.CaseSensitiveColumnNames.ShouldBeTrue();
        }
コード例 #2
0
        public void SqlServerIdentityInsertCalledTwiceAddsCorrectAdditionalFeature()
        {
            var expression = new InsertDataExpression();
            var builder = new InsertDataExpressionBuilder(expression);
            builder.WithIdentityInsert().WithIdentityInsert();

            expression.AdditionalFeatures.ShouldContain(
                new System.Collections.Generic.KeyValuePair<string, object>(SqlServerExtensions.IdentityInsert, true));
        }
コード例 #3
0
        public void CanAddDataTableAndRowsInsertedSeperately()
        {
            var expression = new InsertDataExpression();

             var builder = new InsertDataExpressionBuilder(expression);
             builder
            .DataTable("data.xml");

             expression.DataTableFile.ShouldBe("data.xml");
             expression.InsertRowsSeparately.ShouldBeTrue();
        }
コード例 #4
0
        public void RowsGetSetWhenRowIsCalled()
        {
            var expression = new InsertDataExpression();

            var builder = new InsertDataExpressionBuilder(expression);
            builder
                .Row(new { Data1 = "Row1Data1", Data2 = "Row1Data2" })
                .Row(new { Data1 = "Row2Data1", Data2 = "Row2Data2" });

            expression.Rows.Count.ShouldBe(2);
        }
コード例 #5
0
        public void CanAddMultipleReplacementValues()
        {
            var expression = new InsertDataExpression();

             var builder = new InsertDataExpressionBuilder(expression);
             builder
            .WithReplacementValue(string.Empty, " ")
            .WithReplacementValue(string.Empty, "Foo");

             expression.ReplacementValues.Count.ShouldBe(1);
             expression.ReplacementValues.ContainsKey(string.Empty).ShouldBeTrue();
             expression.ReplacementValues[string.Empty].ShouldBe("Foo");
        }
コード例 #6
0
        public void NoCaseSensitiveByDefault()
        {
            var expression = new InsertDataExpression();

             var builder = new InsertDataExpressionBuilder(expression);

             expression.CaseSensitiveColumnNames.ShouldBeFalse();
        }
コード例 #7
0
        public void CanSetInsertRowsSeparately()
        {
            var expression = new InsertDataExpression();

             var builder = new InsertDataExpressionBuilder(expression);
             builder
            .InsertRowsSeparately();

             expression.InsertRowsSeparately.ShouldBeTrue();
        }
コード例 #8
0
        public void CanAddWithIdentityOnColumn()
        {
            var expression = new InsertDataExpression();

              var builder = new InsertDataExpressionBuilder(expression);
              builder
             .WithIdentity().OnColumn("Test");

              expression.WithIdentity.ShouldBeTrue();
              expression.IdentityColumn.ShouldBe("Test");
        }
コード例 #9
0
        public void CanAddWithIdentity()
        {
            var expression = new InsertDataExpression();

             var builder = new InsertDataExpressionBuilder(expression);
             builder
            .WithIdentity();

             expression.WithIdentity.ShouldBeTrue();
        }