how to create a mock dataset and unit test for void method.
I have a method whose return type is void. This method has two parameters, a strongly typed datarow and dataset.
private void Check(Dataset testDB, DataRow testRow)
{
if(testRow.Amount>10)
{
decimal rate = testRow.Rate;
if(rate >= 100)
{
AddData(testDB,testRow,"some text");
}
}
}
private void AddData(Dataset testDB, DataRow testRow, string notes)
{
Dataset.StudentRow newRow=testDB.Students.NewStudentRow();
.
.
.
testDB.Students.AddStudentRow(newRow);
}