Skip to content

Add a MockColumn class to manage the column type

Latest
Compare
Choose a tag to compare
@dvoituron dvoituron released this 02 Sep 14:32
· 57 commits to master since this release
d446f0e
  • Add a MockColumn class to manage the column type. See example using "typed columns" above.

Sample using a MockTable.WithColumns() typed columns. In this case, columns are defined using a tuple (ColumnName, ColumnType).

conn.Mocks
    .WhenAny()
    .ReturnsTable(MockTable.WithColumns(("ID", typeof(int?)),
                                        ("Name", typeof(string)))
                            .AddRow(null, "Scott")
                            .AddRow(2, "Bill"));
  • Breaking change: to allow typed MockColumn, the property MockTable.Columns is now of type MockColumn[] (previously string[]).

Packages: https://www.nuget.org/packages/DbMocker