public static API_NUnit_Gui insert_REPL_Below(this API_NUnit_Gui nUnitGui)
        {
            var _panel = nUnitGui.nUnitForm.insert_Below("Script NUnit GUI");

            nUnitGui.nUnitForm.script_Me(_panel);
            return(nUnitGui);
        }
        public static bool launchNUnitGui()
		{
			var nUnitGui = new API_NUnit_Gui(); 
			
			var file = @"C:\O2\_tempDir\12-12-2011\tmp7579.tmp.cs";
			return nUnitGui.compileAndOpen(file);	
		}
示例#3
0
        public static API_NUnit_Gui openNUnitGui(this API_NUnit_Gui nUnitGui)
        {
            var nunitGuiRunner = nUnitGui.installer.Executable.parentFolder().pathCombine("lib\\nunit-gui-runner.dll");

            nunitGuiRunner.loadAssemblyAndAllItsDependencies();
            nunitGuiRunner.type("AppEntry").method("Main").invokeStatic_StaThread(new string[] {});
            return(nUnitGui);
        }
示例#4
0
 public static API_NUnit_Gui compileOpenAndRun(this API_NUnit_Gui api_NUnitGui, string fileToCompile)
 {
     if (api_NUnitGui.compileAndOpen(fileToCompile))
     {
         api_NUnitGui.runAllTests();
     }
     return(api_NUnitGui);
 }
示例#5
0
        public static API_NUnit_Gui openNUnitGui_in_SeparateAppDomain(this API_NUnit_Gui nUnitGui)
        {
            var script = @"
                            var nunitAPi = new API_NUnit();
							nunitAPi.openNUnitGui();
							//O2File:API_NUnit.cs"                            ;

            script.execute_InScriptEditor_InSeparateAppDomain();
            return(nUnitGui);
        }
示例#6
0
        public static bool compileAndOpen(this API_NUnit_Gui nUnitGui, string fileToCompile)
        {
            var assembly = new CompileEngine().compileSourceFile(fileToCompile);

            if (assembly.notNull())
            {
                var location = assembly.Location;
                nUnitGui.openProject(location);
                return(true);
            }
            return(false);
        }
示例#7
0
 public static API_NUnit_Gui openProject(this API_NUnit_Gui nUnitGui, string projectOrAssembly)
 {
     if (nUnitGui.guiNotLoaded())
     {
         nUnitGui.loadNUnitGui();
     }
     nUnitGui.form().invokeOnThread(
         () => {
         nUnitGui.form().visible(true);
         TestLoaderUI.OpenProject(nUnitGui.form(), projectOrAssembly);
     });
     return(nUnitGui);
 }
        public static NUnitForm nUnitGui_ShowGui(this API_NUnit_Gui nUnitGui, GuiOptions guiOptions)
        {
            "[API_NUnit_Gui] in nUnitGui_ShowGui".info();
            Func <NUnitForm> createNUnitForm =
                () => {
                var       sync      = new AutoResetEvent(false);
                NUnitForm nUnitForm = null;
                O2Thread.staThread(
                    () => {
                    if (NUnit.Util.Services.TestAgency.isNull())
                    {
                        var nunitGuiRunner = nUnitGui.Executable.parentFolder().pathCombine("lib\\nunit-gui-runner.dll");
                        nunitGuiRunner.loadAssemblyAndAllItsDependencies();

                        SettingsService settingsService = new SettingsService();
                        InternalTrace.Initialize("nunit-gui_%p.log", (InternalTraceLevel)settingsService.GetSetting("Options.InternalTraceLevel", InternalTraceLevel.Default));
                        ServiceManager.Services.AddService(settingsService);
                        ServiceManager.Services.AddService(new DomainManager());
                        ServiceManager.Services.AddService(new RecentFilesService());
                        ServiceManager.Services.AddService(new ProjectService());
                        ServiceManager.Services.AddService(new AddinRegistry());
                        ServiceManager.Services.AddService(new AddinManager());
                        ServiceManager.Services.AddService(new TestAgency());
                        ServiceManager.Services.InitializeServices();
                    }
                    else
                    {
                        "[API_NUnit_Gui] in nUnitGui_ShowGui: NUnit.Util.Services.TestAgency was not null: {0}".debug(NUnit.Util.Services.TestAgency);
                    }

                    ServiceManager.Services.AddService(new TestLoader(new GuiTestEventDispatcher()));
                    nUnitForm = new NUnitForm(guiOptions);
                    "NUnitForm".o2Cache(nUnitForm);
                    sync.Set();
                    nUnitForm.ShowDialog();
                    "NUnitForm".o2Cache(null);
                });
                sync.WaitOne();
                return(nUnitForm);
            };

            return("NUnitForm".o2Cache(createNUnitForm));
        }
示例#9
0
 public static API_NUnit_Gui closeProject(this API_NUnit_Gui nUnitGui)
 {
     TestLoaderUI.CloseProject(nUnitGui.form());
     return(nUnitGui);
 }
示例#10
0
 public static bool guiNotLoaded(this API_NUnit_Gui nUnitGui)
 {
     return(!nUnitGui.NunitGuiLoaded);
 }
示例#11
0
 public static NUnitForm nUnitGui_ShowGui(this API_NUnit_Gui nUnitGui)
 {
     return(nUnitGui.nUnitGui_ShowGui(new GuiOptions(new string[] {})));
 }
示例#12
0
 public static NUnitForm form(this API_NUnit_Gui nUnitGui)
 {
     return(nUnitGui.nUnitForm);
 }
 public static API_NUnit_Gui add_LogViewer(this API_NUnit_Gui nUnitGui)
 {
     nUnitGui.nUnitForm.insert_LogViewer();
     return(nUnitGui);
 }
示例#14
0
 public static API_NUnit_Gui set_FormTitle(this API_NUnit_Gui nUnitGui, string newTitle)
 {
     nUnitGui.nUnitForm.set_Text(newTitle);
     return(nUnitGui);
 }
示例#15
0
 public static TestSuiteTreeView treeView_Tests(this API_NUnit_Gui nUnitGui)
 {
     return(nUnitGui.form().control <TestSuiteTreeView>(true));
 }
示例#16
0
 public static API_NUnit_Gui runAllTests(this API_NUnit_Gui nUnitGui)
 {
     nUnitGui.treeView_Tests().RunAllTests();
     return(nUnitGui);
 }
示例#17
0
 public static API_NUnit_Gui visible(this API_NUnit_Gui nUnitGui, bool value)
 {
     nUnitGui.nUnitForm.visible(value);
     return(nUnitGui);
 }