コード例 #1
0
ファイル: UnitTests.cs プロジェクト: CloudIDEaaS/hydra
        internal static void RunUnitTests()
        {
            try
            {
                ControlExtensions.ShowConsoleInSecondaryMonitor(FormWindowState.Normal);

                Console.WriteLine("Starting Unit Tests");

                // XPathParser tests
                {
                    using ("Test XPathParser".Start(true))
                    {
                        //TestXPathParser();
                    }
                }

                // ModuleImports Creation tests
                {
                    using ("Test ModuleImports Creation".Start(true))
                    {
                        TestModuleImportsCreation();
                    }
                }

                // JSON tests
                {
                    using ("Test Folder To JSON".Start(true))
                    {
                        TestFolderToJson();
                    }
                }

                // navigation property test
                {
                    using ("Test Navigation Properties".Start(true))
                    {
                        //TestNavigationProperties();
                    }
                }

                // LoadParentPathAttribute test
                {
                    using ("Test Queries".Start(true))
                    {
                        // TestQueries();
                    }
                }

                // LoadParentPathAttribute test
                {
                    using ("Test Web Proxy".Start(true))
                    {
                        // TestWebProxy();
                    }
                }

                // TestFileLocks test
                {
                    using ("Test File Locks".Start(true))
                    {
                        // TestFileLocks();
                    }
                }

                // GetDecimalSeconds test
                {
                    using ("Get Decimal Seconds".Start(true))
                    {
                        TestGetDecimalSeconds();
                    }
                }

                // MemoryUsageForCurrentProcess test
                {
                    using ("Test Memory Usage".Start(true))
                    {
                        TestMemoryUsage();
                    }
                }

                // SemVer test
                {
                    using ("Test SemVer".Start(true))
                    {
                        TestSemVer();
                    }
                }

                // DotNetType mappings test
                {
                    using ("Test DotNetType".Start(true))
                    {
                        TestDotNetType();
                    }
                }

                // PackageWorkingInstallFromCache test
                {
                    using ("Test PackageWorkingInstallFromCache".Start(true))
                    {
                        // TestPackageWorkingInstallFromCache();
                    }
                }

                // JSON cloning test
                {
                    using ("Test JSON cloning".Start(true))
                    {
                        TestJsonCloning();
                    }
                }
            }
            catch (Exception ex)
            {
                var hwndConsole = ControlExtensions.GetConsoleWindow();

                Console.WriteLine("UnitTest: '{0}' failed.  Exception: {1}", TestName, ex.Message);
                ControlExtensions.Flash(hwndConsole, FlashWindowFlags.FLASHW_ALL | FlashWindowFlags.FLASHW_TIMERNOFG, 0, 1000);
                return;
            }

            Console.WriteLine("\r\nUnit Tests Completed Successfully!\r\n");
        }