我有一個DataGrid,它顯示程序集中可用的類和方法。 在這裏,我AVE連接的數據網格有關數據的C#問題Grid
的圖片alt text http://img150.imageshack.us/img150/5109/datagrid.png
現在我的任務是基於DataGrid中值測試用例。這裏有幾個測試用例。
namespace proj.Test {
using System;
using NUnit.Framework;
using proj;
[TestFixture()]
public class TestClass1 {
[Test()]
public virtual void Testadd1() {
Class1 Class1 = new Class1();
int a = 2147483647;
int b = 2147483647;
}
[Test()]
public virtual void Testadd2() {
Class1 Class1 = new Class1();
int a = 2147483647;
int b = -2147483648;
}
[Test()]
public virtual void Testadd3() {
Class1 Class1 = new Class1();
int a = 2147483647;
int b = -2147483647;
}
[Test()]
public virtual void Testadd4() {
Class1 Class1 = new Class1();
int a = 2147483647;
int b = 2147483646;
}
}
}
現在的問題是,DataGrid中的所有值均爲String。我需要轉換成像System.Reflection.MethodInfo,System.Type等類型,以便我可以生成這樣的測試用例?
我該怎麼做,或者是否有其他可能性來生成這樣的測試用例?
但事情是,我應該能夠編輯我的dataGrid中的值,因此我必須根據dataGrid值生成testCases。 也來自一個XML,從中我填充了dataGrid的值。 – SyncMaster 2009-03-06 14:02:06