public void SetUp()
 {
     if (!IdeApp.IsInitialized)
     {
         IdeApp.Initialize(new ProgressMonitor());
     }
 }
        public ProjectTemplateTest(string basename, string templateId)
        {
            if (templatingService == null)
            {
                templatingService = new TemplatingService();
            }

            if (!IdeApp.IsInitialized)
            {
                IdeApp.Initialize(Util.GetMonitor());
            }

            this.templateId = templateId;

            SolutionDirectory = Util.CreateTmpDir(basename);
            CreateNuGetConfigFile(SolutionDirectory);
            ProjectName = GetProjectName(templateId);

            Config = new NewProjectConfiguration {
                CreateSolution = true,
                CreateProjectDirectoryInsideSolutionDirectory = true,
                CreateGitIgnoreFile = false,
                UseGit       = false,
                Location     = SolutionDirectory,
                ProjectName  = ProjectName,
                SolutionName = ProjectName
            };

            Directory.CreateDirectory(Config.ProjectLocation);
        }
Exemple #3
0
        public async Task TestToggle_Visible()
        {
            IdeApp.Initialize(new Core.ProgressMonitor());
            //This dummyEditor is just so we can reuse CreateTextEditor code
            //to resolve offset for us
            var dummyEditor = CreateTextEditor(@"class Foo
{
	void Bar ()
	{
		//$test
	}
}");
            //We need to create full document and not just editor
            //so extensions are initialized which set custom C#
            //tagger based syntax highligthing
            var document = IdeApp.Workbench.NewDocument("a.cs", "text/x-csharp", dummyEditor.Text);

            document.Editor.CaretOffset = dummyEditor.CaretOffset;
            //Call UpdateParseDocument so AdHock Roslyn Workspace is created for file
            await document.UpdateParseDocument();

            var info = new Components.Commands.CommandInfo();

            //Finnaly call command Update so it sets values which we assert
            GetExtension(document.Editor).OnUpdateToggleComment(info);
            await document.Close();

            Assert.AreEqual(true, info.Visible);
            Assert.AreEqual(true, info.Enabled);
        }
 public void SetUp()
 {
     DesktopService.Initialize();
     if (!IdeApp.IsInitialized)
     {
         IdeApp.Initialize(new ProgressMonitor());
     }
 }
 public void SetUp()
 {
     //Initialize IdeApp so IdeApp.Workspace is not null, comment tasks listen to root workspace events.
     if (!IdeApp.IsInitialized)
     {
         IdeApp.Initialize(new ProgressMonitor());
     }
 }
 protected override void InternalSetup(string rootDir)
 {
     base.InternalSetup(rootDir);
     if (!IdeApp.IsInitialized)
     {
         IdeApp.Initialize(new ProgressMonitor());
     }
 }
        public void SetUp()
        {
            string runTests = Environment.GetEnvironmentVariable("DOTNETCORE_IGNORE_PROJECT_TEMPLATE_TESTS");

            if (!string.IsNullOrEmpty(runTests))
            {
                Assert.Ignore("Ignoring DotNetCoreProjectTemplateTests");
            }

            templatingService = new TemplatingService();

            if (!IdeApp.IsInitialized)
            {
                IdeApp.Initialize(Util.GetMonitor());
            }
        }
Exemple #8
0
        public void SetUp()
        {
            string runTests = Environment.GetEnvironmentVariable("DOTNETCORE_IGNORE_PROJECT_TEMPLATE_TESTS");

            if (!string.IsNullOrEmpty(runTests))
            {
                Assert.Ignore("Ignoring DotNetCoreProjectTemplateTests");
            }

            templatingService = new TemplatingService();

            if (!firstRun)
            {
                firstRun = true;
                Xwt.Application.Initialize(Xwt.ToolkitType.Gtk);
                DesktopService.Initialize();
                IdeApp.Initialize(Util.GetMonitor());
            }
        }
Exemple #9
0
        public async Task MetadataReferencesToFrameworkAssembliesAreProperlyFound()
        {
            if (!IdeApp.IsInitialized)
            {
                IdeApp.Initialize(new ProgressMonitor());
            }

            FilePath projFile = Util.GetSampleProject("workspace-metadata-references", "workspace-metadata-references.sln");

            using (var sol = (MonoDevelop.Projects.Solution) await Services.ProjectService.ReadWorkspaceItem(Util.GetMonitor(), projFile)) {
                using (var ws = await TypeSystemServiceTestExtensions.LoadSolution(sol)) {
                    DotNetProject mainProject = null, libraryProject = null, libraryProject461 = null;
                    foreach (var project in sol.GetAllProjects())
                    {
                        if (project.Name == "workspace-metadata-references")
                        {
                            mainProject = (DotNetProject)project;
                        }
                        else if (project.Name == "library-project")
                        {
                            libraryProject = (DotNetProject)project;
                        }
                        else if (project.Name == "library-project-net461")
                        {
                            libraryProject461 = (DotNetProject)project;
                        }
                    }

                    Assert.IsNotNull(mainProject);
                    Assert.IsNotNull(libraryProject);

                    // Also, add test for net461 to net47.
                    await AddAssemblyReference(ws, libraryProject, mainProject, "System.Messaging");
                    await AddAssemblyReference(ws, libraryProject461, mainProject, "System.ServiceModel");
                }
            }
        }
Exemple #10
0
 public void Start()
 {
     DesktopService.Initialize();
     IdeApp.Initialize(new ProgressMonitor());
     IdeApp.Workspace.ActiveConfigurationId = "Debug";
 }