public void CanAddCaseSensitiveColumnNames() { var expression = new InsertDataExpression(); var builder = new InsertDataExpressionBuilder(expression); builder.WithCaseSensitiveColumnNames(); expression.CaseSensitiveColumnNames.ShouldBeTrue(); }
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)); }
public void CanAddDataTableAndRowsInsertedSeperately() { var expression = new InsertDataExpression(); var builder = new InsertDataExpressionBuilder(expression); builder .DataTable("data.xml"); expression.DataTableFile.ShouldBe("data.xml"); expression.InsertRowsSeparately.ShouldBeTrue(); }
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); }
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"); }
public void NoCaseSensitiveByDefault() { var expression = new InsertDataExpression(); var builder = new InsertDataExpressionBuilder(expression); expression.CaseSensitiveColumnNames.ShouldBeFalse(); }
public void CanSetInsertRowsSeparately() { var expression = new InsertDataExpression(); var builder = new InsertDataExpressionBuilder(expression); builder .InsertRowsSeparately(); expression.InsertRowsSeparately.ShouldBeTrue(); }
public void CanAddWithIdentityOnColumn() { var expression = new InsertDataExpression(); var builder = new InsertDataExpressionBuilder(expression); builder .WithIdentity().OnColumn("Test"); expression.WithIdentity.ShouldBeTrue(); expression.IdentityColumn.ShouldBe("Test"); }
public void CanAddWithIdentity() { var expression = new InsertDataExpression(); var builder = new InsertDataExpressionBuilder(expression); builder .WithIdentity(); expression.WithIdentity.ShouldBeTrue(); }