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); }
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); }
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()); }
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); }
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); }
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); }
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)); }
public static API_NUnit openNUnitGui(this API_NUnit nUnitApi) { return(nUnitApi.openNUnitGui(null)); }
public static API_NUnit start(this API_NUnit nUnitApi) { return(nUnitApi.openNUnitGui()); }
public static API_NUnit runProject(this API_NUnit nUnitApi, string projectOrAssembly) { return(nUnitApi.openNUnitGui(projectOrAssembly, "/run")); }
public static API_NUnit openProject(this API_NUnit nUnitApi) { return(nUnitApi.openProject(null)); }
public static Process nUnit_Run_Show_Console_on_PopupWindow(this string projectOrAssembly) { var nunit = new API_NUnit(); return(nunit.console_Run_on_PopupWindow(projectOrAssembly)); }
public static Process console_Run(this API_NUnit nUnitApi, string target, string extraStartupOptions) { return(nUnitApi.console_Run(target, extraStartupOptions, (line) => line.info())); }
public static bool compileAndOpen(this API_NUnit nUnitApi, string fileToCompile) { return(nUnitApi.compileAndOpen(fileToCompile, "")); }
public static string nUnit_Run(this string projectOrAssembly) { var nunit = new API_NUnit(); return nunit.console_Run_GetConsoleOut(projectOrAssembly); }
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)); }
public static string console_Run_GetConsoleOut(this API_NUnit nUnitApi, string projectOrAssembly) { return(nUnitApi.console_Run_GetConsoleOut(projectOrAssembly, null)); }
public static Process console_Run_on_PopupWindow(this API_NUnit nUnitApi, string projectOrAssembly, string extraStartupOptions) { return(nUnitApi.console_Run_on_PopupWindow(projectOrAssembly, extraStartupOptions, true)); }
public static Process console_Run_on_PopupWindow(this API_NUnit nUnitApi, string projectOrAssembly) { return(nUnitApi.console_Run_on_PopupWindow(projectOrAssembly, null)); }
public static API_NUnit openNUnitGui(this API_NUnit nUnitApi, string projectOrAssembly) { return(nUnitApi.openNUnitGui(projectOrAssembly, null)); }
public static Process executeNUnitConsole(this API_NUnit nUnitApi, string parameters) { return(nUnitApi.executeNUnitConsole(parameters, (line) => line.info())); }
public static Process executeNUnitConsole(this API_NUnit nUnitApi) { return(nUnitApi.executeNUnitConsole("", (line) => line.info())); }
public static string nUnit_Run(this string projectOrAssembly) { var nunit = new API_NUnit(); return(nunit.console_Run_GetConsoleOut(projectOrAssembly)); }
public static Process console_Run(this API_NUnit nUnitApi, string target) { return(nUnitApi.console_Run(target, null)); }
public static Process nUnit_Run_Show_Console_on_PopupWindow(this string projectOrAssembly) { var nunit = new API_NUnit(); return nunit.console_Run_on_PopupWindow(projectOrAssembly); }
public static string console_Run_GetXml(this API_NUnit nUnitApi, string projectOrAssembly) { return(nUnitApi.console_Run_GetXml(projectOrAssembly).fileContents()); }