Ejemplo n.º 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);
            }
        }
Ejemplo n.º 2
0
        private void TestEngineThreadMain()
        {
            var xEngine = new Engine();

            DefaultEngineConfiguration.Apply(xEngine);

            var xOutputXml = new OutputHandlerXml();

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

            xEngine.Execute();
        }
Ejemplo n.º 3
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);
            }
        }