public void WatchRemoveWatcher()
        {
            FileWatcher projectWatcher = null;

            nUnitPresenterArxNet = NewPresenter(false);
            //private TestLoaderArxNet loader = null;
            TestLoaderArxNet loader = UnitTestHelper.GetNonPublicField(nUnitPresenterArxNet, "loader") as TestLoaderArxNet;
            loader.NewProject();

            nUnitPresenterArxNet.WatchProject(loader.TestProject.ProjectPath);
            //private FileWatcher projectWatcher = null;
            projectWatcher = UnitTestHelper.GetNonPublicField(nUnitPresenterArxNet, "projectWatcher") as FileWatcher;
            Assert.That(projectWatcher, Is.Not.Null);
            //private string filePath;
            string filePath = UnitTestHelper.GetNonPublicField(projectWatcher, "filePath") as string;
            Assert.That(filePath, Is.SamePath(loader.TestProject.ProjectPath));
            //private FileSystemWatcher watcher;
            FileSystemWatcher watcher = UnitTestHelper.GetNonPublicField(projectWatcher, "watcher") as FileSystemWatcher;
            Assert.That(watcher.EnableRaisingEvents, Is.True);

            nUnitPresenterArxNet.RemoveWatcher();
            //private FileWatcher projectWatcher = null;
            projectWatcher = UnitTestHelper.GetNonPublicField(nUnitPresenterArxNet, "projectWatcher") as FileWatcher;
            Assert.That(projectWatcher, Is.Null);
        }
 public void ConstructorAndForm()
 {
     NUnitFormArxNet expectedForm = new NUnitFormArxNet(new GuiOptionsArxNet(new string[0]));
     TestLoaderArxNet expectedLoader = new TestLoaderArxNet();
     nUnitPresenterArxNet = new NUnitPresenterArxNet(expectedForm, expectedLoader);
     Assert.That(nUnitPresenterArxNet.Form, Is.EqualTo(expectedForm));
     //private TestLoaderArxNet loader = null;
     TestLoaderArxNet actualLoader = UnitTestHelper.GetNonPublicField(nUnitPresenterArxNet, "loader") as TestLoaderArxNet;
     Assert.That(actualLoader, Is.EqualTo(expectedLoader));
 }
 public void AddAssembly()
 {
     nUnitPresenterArxNet = NewPresenter(false);
     nUnitPresenterArxNet.NewProject();
     nUnitPresenterArxNet.AddAssembly();
     TestLoaderArxNet loader = UnitTestHelper.GetNonPublicField(nUnitPresenterArxNet, "loader") as TestLoaderArxNet;
     ProjectConfig config = loader.TestProject.ActiveConfig;
     if (config.Assemblies !=null && config.Assemblies.Count > 0)
     {
         string assembly = config.Assemblies[config.Assemblies.Count - 1];
         CADApplication.ShowAlertDialog("添加的程序集为:" + assembly);
     }
     else
         CADApplication.ShowAlertDialog("没添加程序集!");
 }
        public void AddToProject()
        {
            nUnitPresenterArxNet = NewPresenter(false);
            nUnitPresenterArxNet.NewProject();
            ServicesArxNet.UserSettings.SaveSetting("Options.TestLoader.VisualStudioSupport", true);
            nUnitPresenterArxNet.AddToProject("Debug");

            TestLoaderArxNet loader = UnitTestHelper.GetNonPublicField(nUnitPresenterArxNet, "loader") as TestLoaderArxNet;
            NUnitProject project = loader.TestProject;
            ProjectConfig config = project.Configs[project.Configs.Count - 1];
            if (config.Assemblies !=null && config.Assemblies.Count > 0)
            {
                string assembly = config.Assemblies[config.Assemblies.Count - 1];
                CADApplication.ShowAlertDialog("最后一个程序集为:" + assembly);
            }
            else
                CADApplication.ShowAlertDialog("没添加程序集!");

            CADApplication.ShowAlertDialog("最后一个项目文件:" + config.ConfigurationFilePath);
        }
        private NUnitPresenterArxNet NewPresenter(bool form_loader_null)
        {
            NUnitPresenterArxNet presenter = null;

            if (form_loader_null)
            {
                presenter = new NUnitPresenterArxNet(null, null);
            }
            else
            {
                NUnitFormArxNet form = new NUnitFormArxNet(new GuiOptionsArxNet(new string[0]));
                TestLoaderArxNet loader = new TestLoaderArxNet();
                presenter = new NUnitPresenterArxNet(form, loader);
            }

            return presenter;
        }
 public void ReloadProject()
 {
     nUnitPresenterArxNet = NewPresenter(false);
     nUnitPresenterArxNet.NewProject();
     nUnitPresenterArxNet.ReloadProject();
 }
 public void SaveProjectIfDirty()
 {
     nUnitPresenterArxNet = NewPresenter(false);
     nUnitPresenterArxNet.NewProject();
     nUnitPresenterArxNet.AddAssembly();
     DialogResult result = (DialogResult)UnitTestHelper.CallNonPublicMethod(nUnitPresenterArxNet, "SaveProjectIfDirty", null);
     CADApplication.ShowAlertDialog("DialogResult:" + result);
 }
 public void SaveProjectIfDirty_form_loader_null()
 {
     nUnitPresenterArxNet = NewPresenter(true);
     DialogResult result = (DialogResult)UnitTestHelper.CallNonPublicMethod(nUnitPresenterArxNet, "SaveProjectIfDirty", null);
     CADApplication.ShowAlertDialog("DialogResult:" + result);
 }
 public void SaveProjectAs()
 {
     nUnitPresenterArxNet = NewPresenter(false);
     nUnitPresenterArxNet.NewProject();
     nUnitPresenterArxNet.SaveProjectAs();
 }
 public void SaveProjectAs_form_loader_null()
 {
     nUnitPresenterArxNet = NewPresenter(true);
     nUnitPresenterArxNet.SaveProjectAs();
 }
 public void AddToProject_form_loader_null()
 {
     nUnitPresenterArxNet = NewPresenter(true);
     nUnitPresenterArxNet.AddToProject();
 }
        public void AddVSProject()
        {
            nUnitPresenterArxNet = NewPresenter(false);
            nUnitPresenterArxNet.NewProject();
            nUnitPresenterArxNet.AddVSProject();

            TestLoaderArxNet loader = UnitTestHelper.GetNonPublicField(nUnitPresenterArxNet, "loader") as TestLoaderArxNet;
            NUnitProject project = loader.TestProject;
            ProjectConfig config = project.Configs[project.Configs.Count - 1];
            CADApplication.ShowAlertDialog("添加的VS项目文件:" + config.ConfigurationFilePath);
        }
 public void AddAssembly_form_loader_null()
 {
     nUnitPresenterArxNet = NewPresenter(true);
     nUnitPresenterArxNet.AddAssembly();
 }
 public void OpenProject()
 {
     nUnitPresenterArxNet = NewPresenter(false);
     nUnitPresenterArxNet.OpenProject();
 }
 public void EditProject()
 {
     nUnitPresenterArxNet = NewPresenter(false);
     nUnitPresenterArxNet.NewProject();
     nUnitPresenterArxNet.AddAssembly();
     nUnitPresenterArxNet.EditProject();
 }
 public void CloseProject_form_loader_null()
 {
     nUnitPresenterArxNet = NewPresenter(true);
     DialogResult result = (DialogResult)nUnitPresenterArxNet.CloseProject();
     CADApplication.ShowAlertDialog("DialogResult:" + result);
 }
 public void CloseProject()
 {
     nUnitPresenterArxNet = NewPresenter(false);
     nUnitPresenterArxNet.NewProject();
     nUnitPresenterArxNet.AddAssembly();
     DialogResult result = (DialogResult)nUnitPresenterArxNet.CloseProject();
     CADApplication.ShowAlertDialog("DialogResult:" + result);
 }
        public void SaveLastResult()
        {
            nUnitPresenterArxNet = NewPresenter(false);
            nUnitPresenterArxNet.NewProject();
            nUnitPresenterArxNet.AddAssembly();
            TestLoaderArxNet loader = UnitTestHelper.GetNonPublicField(nUnitPresenterArxNet, "loader") as TestLoaderArxNet;
            loader.LoadTest();
            loader.RunTests();

            nUnitPresenterArxNet.SaveLastResult();
        }
 public void SaveLastResult_form_loader_null()
 {
     nUnitPresenterArxNet = NewPresenter(true);
     nUnitPresenterArxNet.SaveLastResult();
 }
        public NUnitFormArxNet( GuiOptions guiOptions )
            : base("NUnit")
        {
            InitializeComponent();

            this.guiOptions = guiOptions;
            this.recentFilesService = ServicesArxNet.RecentFiles;
            this.userSettings = ServicesArxNet.UserSettings;

            this.presenter = new NUnitPresenterArxNet(this, TestLoader);

            //����ǰһCAD��ĵ�
            //prevActiveDocument = CADApplication.DocumentManager.MdiActiveDocument;
            //CADApplication.DocumentManager.MdiActiveDocument.Window.h
        }
Exemplo n.º 21
0
        public NUnitFormArxNet( GuiOptionsArxNet guiOptions )
            : base("NUnit")
        {
            InitializeComponent();

            this.guiOptions = guiOptions;
            this.recentFilesService = ServicesArxNet.RecentFiles;
            this.userSettings = ServicesArxNet.UserSettings;

            this.presenter = new NUnitPresenterArxNet(this, TestLoader);
        }