public void ExampleUsingNewPattern() { var table = new DataTableBuilder() .WithColumn("ID", 1) .WithColumn("Name", "Matthew") .WithColumn("DOB", new DateTime(1978, 8, 2)) .WithColumn("Amount", 1.23d) .WithColumn("Flag", true) .Build(); AssertColumnNames(table); AssertColumnDataTypes(table); AssertFirstRow(table); }
public void ExampleUsingNewPatternWithNoRows() { var table = new DataTableBuilder() .WithColumn <int>("ID") .WithColumn <string>("Name") .WithColumn <DateTime>("DOB") .WithColumn <double>("Amount") .WithColumn <bool>("Flag") .Build(); AssertColumnNames(table); AssertColumnDataTypes(table); Assert.That(table.Rows, Is.Empty); }
public void ExampleUsingNewPatternWithMultipleRows() { var table = new DataTableBuilder() .WithColumn <int>("ID") .WithColumn <string>("Name") .WithColumn <DateTime>("DOB") .WithColumn <double>("Amount") .WithColumn <bool>("Flag") .WithRow(1, "Matthew", new DateTime(1978, 8, 2), 1.23d, true) .WithRow(2, "Renze", new DateTime(2001, 2, 3), 2.34d, false) .Build(); AssertColumnNames(table); AssertColumnDataTypes(table); AssertFirstRow(table); AssertSecondRow(table); }
public void SetUp() { _builder = new DataTableBuilder(); }