Beispiel #1
0
        public static AutomationTesterHarness RunTest(
            Action <AutomationTesterHarness> testToRun,
            string staticDataPathOverride      = null,
            double maxTimeToRun                = 60,
            QueueTemplate queueItemFolderToAdd = QueueTemplate.None)
        {
            // Walk back a step in the stack and output the callers name
            StackTrace st = new StackTrace(false);

            Console.WriteLine("\r\nRunning automation test: " + st.GetFrames().Skip(1).First().GetMethod().Name);

            if (staticDataPathOverride == null)
            {
                staticDataPathOverride = Path.Combine("..", "..", "..", "..", "StaticData");
            }

#if !__ANDROID__
            // Set the static data to point to the directory of MatterControl
            StaticData.Instance = new MatterHackers.Agg.FileSystemStaticData(staticDataPathOverride);
#endif
            MatterControlUtilities.OverrideAppDataLocation();

            if (queueItemFolderToAdd != QueueTemplate.None)
            {
                string queueTemplateDirectory = queueItemFolderToAdd.ToString();
                MatterControlUtilities.AddItemsToQueue(queueTemplateDirectory);
            }

            MatterControlApplication matterControlWindow = MatterControlApplication.CreateInstance();
            return(AutomationTesterHarness.ShowWindowAndExectueTests(matterControlWindow, testToRun, maxTimeToRun));
        }