I am curious why you need to mock DataRow. Sometimes you can be catching up with mockery and forget that it can be just as wise to use the real thing. If you are passing data rows, you can simply create an instance using the helper method and use this as the return value for your layout.
SetupResult.For(someMockClass.GetDataRow(input)).Return(GetReturnRow()); public DataRow GetReturnRow() { DataTable table = new DataTable("FakeTable"); DataRow row = table.NewRow(); row.value1 = "someValue"; row.value2 = 234; return row; }
If this is not the situation you are in, I will need some sample code to understand what you are trying to do.
source share