Beispiel #1
0
        static void Main(string[] args)
        {
            var xEngine = new Engine();

            DefaultEngineConfiguration.Apply(xEngine);

            var xOutputXml = new OutputHandlerXml();

            xEngine.OutputHandler = new MultiplexingOutputHandler(
                xOutputXml,
                new OutputHandlerFullConsole());

            xEngine.Execute();

            global::System.Console.WriteLine("Do you want to save test run details?");
            global::System.Console.Write("Type yes, or nothing to just exit: ");
            var xResult = global::System.Console.ReadLine();

            if (xResult != null && xResult.Trim().Equals("yes", StringComparison.OrdinalIgnoreCase))
            {
                var xSaveDialog = new SaveFileDialog();
                xSaveDialog.Filter = "XML documents|*.xml";
                if (xSaveDialog.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                xOutputXml.SaveToFile(xSaveDialog.FileName);
            }
        }
Beispiel #2
0
        private static void Main(string[] args)
        {
            var xLogPath = Path.Combine(
                Path.GetDirectoryName(typeof(Program).Assembly.Location), "WorkingDirectory", "TestRunnerLog.xml");

            if (args.Length == 1)
            {
                xLogPath = args[0];
            }

            var xEngineConfiguration = new DefaultEngineConfiguration();
            var xOutputHandler       = new OutputHandlerFullConsole();

            var xEngine = new FullEngine(xEngineConfiguration);

            xEngine.SetOutputHandler(xOutputHandler);

            var xResult = xEngine.Execute();

            try
            {
                xResult.SaveXmlToFile(xLogPath);
                Console.WriteLine("Log written to '{0}'.", xLogPath);
            }
            catch (Exception e)
            {
                xOutputHandler.UnhandledException(e);
                Console.ReadKey(true);
            }

            Console.WriteLine("Press any key to exit.");
            Console.ReadKey(true);
        }
Beispiel #3
0
        private void TestEngineThreadMain()
        {
            var xEngine = new Engine();

            DefaultEngineConfiguration.Apply(xEngine);

            var xOutputXml = new OutputHandlerXml();

            xEngine.OutputHandler = new MultiplexingOutputHandler(
                xOutputXml,
                this);

            xEngine.Execute();
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            var xEngine = new Engine();

            DefaultEngineConfiguration.Apply(xEngine);

            var xOutputXml = new OutputHandlerXml();

            xEngine.OutputHandler = new MultiplexingOutputHandler(
                xOutputXml,
                new OutputHandlerFullConsole());

            xEngine.Execute();

            Console.WriteLine("Do you want to save test run details?");
            Console.Write("Type yes, or nothing to just exit: ");
            var xResult = Console.ReadLine();

            if (xResult != null && xResult.Trim().Equals("yes", StringComparison.OrdinalIgnoreCase))
            {
                Console.Write("Path: ");
                xResult = Console.ReadLine();

                try
                {
                    xOutputXml.SaveToFile(xResult);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Exception: " + ex.ToString());
                }

                //var xSaveDialog = new SaveFileDialog();
                //xSaveDialog.Filter = "XML documents|*.xml";
                //if (xSaveDialog.ShowDialog() != DialogResult.OK)
                //{
                //    return;
                //}

                //xOutputXml.SaveToFile(xSaveDialog.FileName);
            }
        }