lundi 2 octobre 2017

Create instances with changing class names

I want to call many tests like this.

        var test8001 = new Test8001();
        test8001.Execute(drv);
        var test8002 = new Test8002();
        test8002.Execute(drv);
        var test8007 = new Test8007();
        test8007.Execute(drv);

How can I automatically instantiate all test function with a int list of all test numbers?

        List<int> classNameNumbers = new List<int>() { 8001, 8002, 8007 };

I need a for-loop where Execute() is called on every instance.

Edit: The Name of the type e.g. 'Test8001' should be retrieved from my integer list.





Aucun commentaire:

Enregistrer un commentaire