예제 #1
0
        public static API_NUnit openNUnitGui(this API_NUnit nUnitApi, string projectOrAssembly, string extraStartupOptions)
        {
            var startUpOpptions = "\"{0}\" {1}".format(projectOrAssembly ?? "", extraStartupOptions ?? "");

            nUnitApi.NUnitProcess = new API_NUnit().Executable.startProcess(startUpOpptions);
            return(nUnitApi);
        }
예제 #2
0
        public static string console_Run_GetXmlFile(this API_NUnit nUnitApi, string projectOrAssembly)
        {
            var tempFile = projectOrAssembly.fileName().tempFile() + ".xml";

            nUnitApi.console_Run_GetConsoleOut(projectOrAssembly, "/xml:\"" + tempFile + "\"");
            return(tempFile);
        }
예제 #3
0
        public static string console_Run_GetConsoleOut(this API_NUnit nUnitApi, string projectOrAssembly, string extraStartupOptions)
        {
            var consoleOut = new StringBuilder();

            nUnitApi.console_Run(projectOrAssembly, extraStartupOptions, (line) => consoleOut.AppendLine(line.info()))
            .WaitForExit();
            return(consoleOut.str());
        }
예제 #4
0
        public static bool compileAndOpen(this API_NUnit nUnitApi, string fileToCompile, string extraStartupOptions)
        {
            //var assembly = new CompileEngine().compileSourceFile(fileToCompile);
            var target = fileToCompile.compileIntoTempFolder();

            if (target.notNull())
            {
                nUnitApi.openNUnitGui(target, extraStartupOptions);
                return(true);
            }
            return(false);
        }
예제 #5
0
        public static bool compileAndOpen(this API_NUnit nUnitApi, string fileToCompile, string extraStartupOptions)
        {
            var assembly = new CompileEngine().compileSourceFile(fileToCompile);

            if (assembly.notNull())
            {
                var location = assembly.Location;
                nUnitApi.openNUnitGui(location, extraStartupOptions);
                return(true);
            }
            return(false);
        }
예제 #6
0
        public static Process console_Run_on_PopupWindow(this API_NUnit nUnitApi, string projectOrAssembly, string extraStartupOptions, bool autoCloseOnSuccess)
        {
            var nunitPopup  = "NUnit Execution of: {0}".format(projectOrAssembly).popupWindow(400, 400);
            var richTextBox = nunitPopup.add_RichTextBox();

            richTextBox.backColor(Color.Azure);
            var             success = false;
            Action <string> logLine =
                (line) => {
                try
                {
                    if (line.valid() && line.contains("Errors:"))
                    {
                        if (line.contains("Errors: 0, Failures: 0"))
                        {
                            richTextBox.backColor(Color.LightGreen);
                            success = true;
                        }
                        else
                        {
                            richTextBox.backColor(Color.LightSalmon);
                        }
                    }
                }
                catch (Exception ex)
                {
                    ex.log();
                }
                richTextBox.append_Line(line);
            };

            var process = nUnitApi.console_Run(projectOrAssembly, "", logLine);

            if (process.notNull() && autoCloseOnSuccess)
            {
                O2Thread.mtaThread(
                    () => {
                    process.WaitForExit();
                    if (success)
                    {
                        nunitPopup.closeForm_InNSeconds(5);
                    }
                });
            }

            nunitPopup.parentForm()
            .alwaysOnTop()
            .top(0).left(700);

            return(process);
        }
예제 #7
0
        public static Process console_Run(this API_NUnit nUnitApi, string target, string extraStartupOptions, Action <string> consoleOut)
        {
            if (target.extension(".cs"))
            {
                //var assembly = new CompileEngine().compileSourceFile(target);
                target = target.compileIntoTempFolder();
                if (target.isNull())
                {
                    "[API_NUnit][console_Run] failed to compile C# file: {0}".error(target);
                    return(null);
                }
            }
            var startUpOptions = "\"{0}\" {1}".format(target ?? "", extraStartupOptions ?? "");

            return(nUnitApi.executeNUnitConsole(startUpOptions, consoleOut));
        }
예제 #8
0
 public static API_NUnit openNUnitGui(this API_NUnit nUnitApi)
 {
     return(nUnitApi.openNUnitGui(null));
 }
예제 #9
0
 public static API_NUnit start(this API_NUnit nUnitApi)
 {
     return(nUnitApi.openNUnitGui());
 }
예제 #10
0
 public static API_NUnit runProject(this API_NUnit nUnitApi, string projectOrAssembly)
 {
     return(nUnitApi.openNUnitGui(projectOrAssembly, "/run"));
 }
예제 #11
0
 public static API_NUnit openProject(this API_NUnit nUnitApi)
 {
     return(nUnitApi.openProject(null));
 }
예제 #12
0
        public static Process nUnit_Run_Show_Console_on_PopupWindow(this string projectOrAssembly)
        {
            var nunit = new API_NUnit();

            return(nunit.console_Run_on_PopupWindow(projectOrAssembly));
        }
예제 #13
0
 public static Process console_Run(this API_NUnit nUnitApi, string target, string extraStartupOptions)
 {
     return(nUnitApi.console_Run(target, extraStartupOptions, (line) => line.info()));
 }
예제 #14
0
 public static bool compileAndOpen(this API_NUnit nUnitApi, string fileToCompile)
 {
     return(nUnitApi.compileAndOpen(fileToCompile, ""));
 }
예제 #15
0
 	public static string nUnit_Run(this string projectOrAssembly)
 	{
 		var nunit = new API_NUnit();  			
 		return nunit.console_Run_GetConsoleOut(projectOrAssembly);
 	}
예제 #16
0
        public static Process executeNUnitConsole(this API_NUnit nUnitApi, string parameters, Action <string> consoleOut)
        {
            var nUnitConsole = nUnitApi.Executable.directoryName().pathCombine("nunit-console.exe");

            return(nUnitConsole.startProcess(parameters, consoleOut));
        }
예제 #17
0
 public static string console_Run_GetConsoleOut(this API_NUnit nUnitApi, string projectOrAssembly)
 {
     return(nUnitApi.console_Run_GetConsoleOut(projectOrAssembly, null));
 }
예제 #18
0
 public static Process console_Run_on_PopupWindow(this API_NUnit nUnitApi, string projectOrAssembly, string extraStartupOptions)
 {
     return(nUnitApi.console_Run_on_PopupWindow(projectOrAssembly, extraStartupOptions, true));
 }
예제 #19
0
 public static Process console_Run_on_PopupWindow(this API_NUnit nUnitApi, string projectOrAssembly)
 {
     return(nUnitApi.console_Run_on_PopupWindow(projectOrAssembly, null));
 }
예제 #20
0
 public static API_NUnit openNUnitGui(this API_NUnit nUnitApi, string projectOrAssembly)
 {
     return(nUnitApi.openNUnitGui(projectOrAssembly, null));
 }
예제 #21
0
 public static Process executeNUnitConsole(this API_NUnit nUnitApi, string parameters)
 {
     return(nUnitApi.executeNUnitConsole(parameters, (line) => line.info()));
 }
예제 #22
0
 public static Process executeNUnitConsole(this API_NUnit nUnitApi)
 {
     return(nUnitApi.executeNUnitConsole("", (line) => line.info()));
 }
예제 #23
0
        public static string nUnit_Run(this string projectOrAssembly)
        {
            var nunit = new API_NUnit();

            return(nunit.console_Run_GetConsoleOut(projectOrAssembly));
        }
예제 #24
0
 public static Process console_Run(this API_NUnit nUnitApi, string target)
 {
     return(nUnitApi.console_Run(target, null));
 }
예제 #25
0
 	public static Process nUnit_Run_Show_Console_on_PopupWindow(this string projectOrAssembly)
 	{
 		var nunit = new API_NUnit();  		
 		return nunit.console_Run_on_PopupWindow(projectOrAssembly);
 	}    	
예제 #26
0
 public static string console_Run_GetXml(this API_NUnit nUnitApi, string projectOrAssembly)
 {
     return(nUnitApi.console_Run_GetXml(projectOrAssembly).fileContents());
 }