Exemple #1
0
        public TestCases generateCases(List <string> funcnames)
        {
            List <TestCase> ls    = new List <TestCase>();
            TestCases       cases = new TestCases();

            tree.ParseFunctions();
            List <Function> funcs   = tree.GetFunctionByNames(funcnames);
            TestCaseBuilder builder = new TestCaseBuilder();

            foreach (Function f in funcs)
            {
                ls.AddRange(builder.BuildTestCases(f, tree.GlobalScope, tree.ParsedFunctions));
            }
            cases.testcases = ls.AsEnumerable();
            return(cases);
        }
Exemple #2
0
        private void button2_Copy_Click(object sender, RoutedEventArgs e)
        {
            Presenter     preseter = Presenter.Instance;
            List <string> names    = new List <string>();

            foreach (CheckBox box in listBox.Items)
            {
                if (true == box.IsChecked)
                {
                    names.Add(box.Content.ToString());
                }
            }

            TestCases cases = preseter.generateCases(names);
            var       html  = Render.StringToString(Properties.Resources.template, cases);

            System.IO.File.WriteAllText(output.Text.ToString(), html);
            MainWindow w = new MainWindow(cases.testcases.ToList());

            w.Show();
        }