Пример #1
0
        public QATestLauncher(Form1 form1)
        {
            var form = form1;

            string extension = Regex.Match(form.testSetup.fileName, "\\.[0-9a-z]+$").Value;
            //Structs.TestPlan testPlan;
            DataTable dataTable;

            switch (extension)
            {
            case ".xlsx":
                dataTable = XlsxReader.ReadExcellSheet(form.testSetup);
                break;

            case ".csv":
                dataTable = CsvReader.ReadCsv(form.testSetup);
                break;

            default:
                dataTable = CsvReader.ReadCsv(form.testSetup);
                break;
            }

            if (TestPlanFromDataTable.IsValid(dataTable))
            {
                testPlan = TestPlanFromDataTable.GetTestPlan(dataTable);
                qATest   = new QATest(testPlan, form1.testSetup);
                qATest.RunFinishedEvent  += OnRunFinished;
                qATest.StepFinishedEvent += OnStepFinished;
            }
        }
Пример #2
0
        //private Structs.TestPlan testPlan;


        public QATestLauncher(IQATestLaunchPoint launchPoint1)
        {
            launchPoint         = launchPoint1; //np. Form1
            testStuff           = launchPoint1.GetTestStuff();
            testPlanAsDataTable = launchPoint1.GetTestPlanAsDataTable();

            if (TestPlanFromDataTable.IsValid(testPlanAsDataTable))
            {
                testStuff.testPlan        = TestPlanFromDataTable.GetTestPlan(testPlanAsDataTable);
                qATest                    = new QATest(testStuff);
                qATest.RunFinishedEvent  += OnRunFinished;
                qATest.StepFinishedEvent += OnStepFinished;
            }
            else
            {
                testStuff.Log("This source doesn't contain a valid test plan or read failed. Test cancelled.");
            }
        }