コード例 #1
0
        public static int RunAllTests()
        {
            var executingAssembly = Assembly.GetExecutingAssembly();
            var assemblyFilename  = executingAssembly.Location;

            var consoleOut = Console.Out;

            var testPackage =
                new TestPackage(assemblyFilename)
            {
                AutoBinPath = true
            };

            testPackage.Settings["ShadowCopyFiles"]   = false;
            testPackage.Settings["UseThreadedRunner"] = false;

            var listener =
                new SledSharedEventListener {
                ConsoleOut = consoleOut
            };

            var testRunner = new RemoteTestRunner();

            testRunner.Load(testPackage);
            testRunner.Run(listener);

            if (listener.FailedTestCount == 0)
            {
                consoleOut.WriteLine("Success: " + listener.TestCount + " test(s) passed.");
            }

            return(listener.FailedTestCount);
        }
コード例 #2
0
ファイル: TestRunner.cs プロジェクト: arsaccol/SLED
        public static int RunAllTests()
        {
            var executingAssembly = Assembly.GetExecutingAssembly();
            var assemblyFilename = executingAssembly.Location;

            var consoleOut = Console.Out;

            var testPackage =
                new TestPackage(assemblyFilename) {AutoBinPath = true};
            testPackage.Settings["ShadowCopyFiles"] = false;
            testPackage.Settings["UseThreadedRunner"] = false;

            var listener =
                new SledSharedEventListener {ConsoleOut = consoleOut};

            var testRunner = new RemoteTestRunner();
            testRunner.Load(testPackage);
            testRunner.Run(listener);

            if (listener.FailedTestCount == 0)
                consoleOut.WriteLine("Success: " + listener.TestCount + " test(s) passed.");

            return listener.FailedTestCount;
        }