NUnit测试用例 - 来自Datatable的字符串数组 [英] NUnit Test Case - String Array from Datatable
问题描述
需要针对以下功能的NUnit测试用例。对于saem函数如果我在函数测试用例内构建了数据表成功。如果它来自DB测试用例失败。
公共ActionResult GetCustomerInfo()
{
DataTable dtCustomerInfo = BL.rptCustomerInfo();
Session [dtCustomerInfo] = dtCustomerInfo;
List< system.collections.arraylist> CustomerInfo = new List< system.collections.arraylist>();
foreach(dtCustomerInfo.Rows中的DataRow dataRow)
{
系统。 Collections.ArrayList values = new System.Collections.ArrayList();
foreach(dataRow.ItemArray中的对象值)
values.Add(value);
CustomerInfo.Add(值);
}
var model = CustomerInfo;
返回模型;
}
问候,
Kalaiselvan
Need NUnit Test Case for the below Function. For the saem function If I Built the Datatable Inside the Function Test Case succeeds. If its comes from DB Test case fails.
public ActionResult GetCustomerInfo()
{
DataTable dtCustomerInfo = BL.rptCustomerInfo();
Session["dtCustomerInfo"] = dtCustomerInfo;
List<system.collections.arraylist> CustomerInfo = new List<system.collections.arraylist>();
foreach (DataRow dataRow in dtCustomerInfo.Rows)
{
System.Collections.ArrayList values = new System.Collections.ArrayList();
foreach (object value in dataRow.ItemArray)
values.Add(value);
CustomerInfo.Add(values);
}
var model = CustomerInfo;
return model;
}
Regards,
Kalaiselvan
这篇关于NUnit测试用例 - 来自Datatable的字符串数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!