1
我有一個返回類型爲void的方法。該方法有兩個參數,一個強類型的數據行和數據集。如何爲void方法編寫單元測試並創建模擬數據集和數據行(數據集和數據行都是強類型的)?
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);
}
我們在這裏有什麼語言?代碼在c#中 – bmargulies 2011-05-04 21:02:29
代碼是在c# – Talk2me 2011-05-04 21:08:39