jeudi 30 juin 2016

Howto create and run a list of type TestClass(with different ctor-props) and run it

I have a TestClass called ActivityTestsFor27Jun and ActivityTestsFor13Sep. These classes contain 6 TestMethods. I have a base class which set-up some things. They share a ton of the same vars. The only different vars are month, day of type int and sunset of type DateTime.

What I want to build is a TestClass called ActivityTest which takes 3 params in his constructor: month, day, sunset

Now I want to make some kind of a start class where I can do this

List<ActivityTest> activityTestList = new List<ActivityTest>();
activityList.add(new ActivityTest(6, 27, sunsetVal1));//27 jun
activityList.add(new ActivityTest(9, 13, sunsetVal2));//13 sep
activityList.add(new ActivityTest(x3, y3, sunsetVal3));// and so on..

And now something like Run(activityTestList);

A link to point me the way is also appreciated!

Aucun commentaire:

Enregistrer un commentaire