コード例 #1
0
ファイル: ConsoleTest.cs プロジェクト: zhza/NetTopologySuite
        static void Main(string[] args)
        {
            // paths *to* the XML files, as well as paths *in* the XML files,
            // assume that we're running from the app's directory; apparently,
            // the VS2017 / new-style SDK changes did something to make that
            // no longer guaranteed to be the case at startup.
            Environment.CurrentDirectory = new FileInfo(Assembly.GetEntryAssembly().Location).Directory.FullName;
            if (args == null || args.Length == 0)
            {
                XmlTestExceptionManager.ErrorEvent += new XmlTestErrorEventHandler(OnErrorEvent);
                RunInteractive(XmlTestType.None, true);
            }
            else
            {
                var parser     = new TestOptionsParser();
                var collection = parser.Parse(args);

                if (parser.IsDefault)
                {
                    RunDefault();
                }
                else
                {
                    if (collection != null)
                    {
                        if (collection.Count == 1)
                        {
                            // see if it is the interactive type
                            var info = collection[0];
                            if (info.Interactive)
                            {
                                if (info.Exception)
                                {
                                    XmlTestExceptionManager.ErrorEvent += new XmlTestErrorEventHandler(OnErrorEvent);
                                }
                                RunInteractive(info.Filter, info.Verbose);
                            }
                        }
                        else
                        {
                            var runner = new TestRunner(collection);
                            runner.Run();
                        }
                    }
                    else
                    {
                        XmlTestExceptionManager.ErrorEvent += new XmlTestErrorEventHandler(OnErrorEvent);
                        RunInteractive(XmlTestType.None, true);
                    }
                }
            }
        }
コード例 #2
0
        static void Main(string[] args)
        {
            if (args == null || args.Length == 0)
            {
                XmlTestExceptionManager.ErrorEvent += new XmlTestErrorEventHandler(OnErrorEvent);
                RunInteractive(XmlTestType.None, true);
            }
            else
            {
                TestOptionsParser  parser     = new TestOptionsParser();
                TestInfoCollection collection = parser.Parse(args);

                if (parser.IsDefault)
                {
                    RunDefault();
                }
                else
                {
                    if (collection != null)
                    {
                        if (collection.Count == 1)
                        {
                            // see if it is the interactive type
                            TestInfo info = collection[0];
                            if (info.Interactive)
                            {
                                if (info.Exception)
                                {
                                    XmlTestExceptionManager.ErrorEvent += new XmlTestErrorEventHandler(OnErrorEvent);
                                }
                                RunInteractive(info.Filter, info.Verbose);
                            }
                        }
                        else
                        {
                            TestRunner runner = new TestRunner(collection);
                            runner.Run();
                        }
                    }
                    else
                    {
                        XmlTestExceptionManager.ErrorEvent += new XmlTestErrorEventHandler(OnErrorEvent);
                        RunInteractive(XmlTestType.None, true);
                    }
                }
            }
        }
コード例 #3
0
ファイル: ConsoleTest.cs プロジェクト: DIVEROVIEDO/DotSpatial
        static void Main(string[] args)
        {
            if (args == null || args.Length == 0)
            {
                XmlTestExceptionManager.ErrorEvent += new XmlTestErrorEventHandler(OnErrorEvent);
                RunInteractive(XmlTestType.None, true);
            }
            else
            {
                TestOptionsParser parser = new TestOptionsParser();
                TestInfoCollection collection = parser.Parse(args);

                if (parser.IsDefault)
                {
                    RunDefault();
                }
                else
                {
                    if (collection != null)
                    {
                        if (collection.Count == 1)
                        {
                            // see if it is the interactive type
                            TestInfo info = collection[0];
                            if (info.Interactive)
                            {
                                if (info.Exception)
                                    XmlTestExceptionManager.ErrorEvent += new XmlTestErrorEventHandler(OnErrorEvent);
                                RunInteractive(info.Filter, info.Verbose);
                            }
                        }
                        else
                        {
                            TestRunner runner = new TestRunner(collection);
                            runner.Run();
                        }
                    }
                    else
                    {
                        XmlTestExceptionManager.ErrorEvent += new XmlTestErrorEventHandler(OnErrorEvent);
                        RunInteractive(XmlTestType.None, true);
                    }
                }
            }

        }