I have a DataGrid which displays the available Classes and Methods in an Assembly. Here i ave attached the picture of dataGrid
alt text http://img150.imageshack.us/img150/5109/datagrid.png
Now my task is to Generate testCases based on the values in the DataGrid. Here are few test Cases.
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; } } }
Now the problem, all values in the DataGrid are as String. I need to convert into types like System.Reflection.MethodInfo, System.Type etc so that i can generate such test cases?
How can I do it, or is there any other possibility to generate such testcases?
You shouldn’t really take the values from the dataGrid itself, because this is just the UI control. Instead, you should find out where are they coming from (where the grid is populated) and hook up there. Then you will have all the data of correct types and hopefully it will not be UI dependent.