Hi,
The method that you want to mock is:
SqlDataAdapter.Fill(DataSet ds);
For this test, you want to fill the DataSet manually, so in the DynamicReturnvValue we can grab the first parameter and set its value.
public object MockFill(object[] parameters, object context)
{
// grab first argument
DataSet ds = (DataSet)parameters[0];
// set fake data on the dataset
FillFakeDataSet(ds);
// Fill returns number of fields
return 2;
}
:idea: You can of course Mock the DataSet instead of filling it with fake data.