Skip to content

Releases: Apps72/DbMocker

Add a MockColumn class to manage the column type

02 Sep 14:32
d446f0e
Compare
Choose a tag to compare
  • 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