Пример #1
0
 public void SetLanguageVersion(ProjectUtils.Project projectName, string languageVersion)
 {
     _inProc.SetLanguageVersion(projectName.Name, languageVersion);
     _instance.Workspace.WaitForAsyncOperations(Helper.HangMitigatingTimeout, FeatureAttribute.Workspace);
 }
Пример #2
0
 public void CloseCodeFile(ProjectUtils.Project project, string fileName, bool saveFile)
 => _inProc.CloseCodeFile(project.Name, fileName, saveFile);
Пример #3
0
 public void RestoreNuGetPackages(ProjectUtils.Project project)
 => _inProc.RestoreNuGetPackages(project.Name);
Пример #4
0
 /// <summary>
 /// Add a PackageReference to the specified project. Generally this should be followed up by
 /// a call to <see cref="RestoreNuGetPackages"/>.
 /// </summary>
 public void AddPackageReference(ProjectUtils.Project project, ProjectUtils.PackageReference package)
 => _inProc.AddPackageReference(project.Name, package.Name, package.Version);
Пример #5
0
 public void AddFile(ProjectUtils.Project project, string fileName, string contents = null, bool open = false)
 => _inProc.AddFile(project.Name, fileName, contents, open);
Пример #6
0
 public void AddProjectReference(ProjectUtils.Project fromProjectName, ProjectUtils.ProjectReference toProjectName)
 {
     _inProc.AddProjectReference(fromProjectName.Name, toProjectName.Name);
     _instance.Workspace.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
Пример #7
0
 public void AddMetadataReference(ProjectUtils.AssemblyReference fullyQualifiedAssemblyName, ProjectUtils.Project projectName)
 {
     _inProc.AddMetadataReference(fullyQualifiedAssemblyName.Name, projectName.Name);
     _instance.Workspace.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
Пример #8
0
 public void RenameFile(ProjectUtils.Project project, string oldFileName, string newFileName)
 => _inProc.RenameFile(project.Name, oldFileName, newFileName);
Пример #9
0
 public void AddProject(ProjectUtils.Project projectName, string projectTemplate, string languageName)
 => _inProc.AddProject(projectName.Name, projectTemplate, languageName);
        public void VerifyReorderAndRemoveParametersAcrossLanguages()
        {
            SetUpEditor(@"
Class VBTest
    Sub TestMethod()
        Dim x As New CSharpClass
        x.Method$$(0, ""str"", 3.0)
    End Sub
End Class");
            var csharpProject = new ProjectUtils.Project("CSharpProject");

            VisualStudio.SolutionExplorer.AddProject(csharpProject, WellKnownProjectTemplates.ClassLibrary, LanguageNames.CSharp);
            VisualStudio.Editor.SetText(@"
public class CSharpClass
{
    /// <summary>
    /// A method in CSharp.
    /// </summary>
    /// <param name=""a"">parameter a</param>
    /// <param name=""b"">parameter b</param>
    /// <param name=""c"">parameter c</param>
    /// <returns>One</returns>
    public int Method(int a, string b, double c)
    {
        return 1;
    }
}");
            VisualStudio.SolutionExplorer.SaveAll();
            var project = new ProjectUtils.Project(ProjectName);
            var csharpProjectReference = new ProjectUtils.ProjectReference("CSharpProject");

            VisualStudio.SolutionExplorer.AddProjectReference(project, csharpProjectReference);
            VisualStudio.SolutionExplorer.OpenFile(project, "Class1.vb");

            VisualStudio.Workspace.WaitForAsyncOperations(FeatureAttribute.Workspace);

            ChangeSignatureDialog.Invoke();
            ChangeSignatureDialog.VerifyOpen();
            ChangeSignatureDialog.SelectParameter("int a");
            ChangeSignatureDialog.ClickRemoveButton();
            ChangeSignatureDialog.SelectParameter("string b");
            ChangeSignatureDialog.ClickRemoveButton();
            ChangeSignatureDialog.SelectParameter("double c");
            ChangeSignatureDialog.ClickRemoveButton();
            ChangeSignatureDialog.SelectParameter("string b");
            ChangeSignatureDialog.ClickDownButton();
            ChangeSignatureDialog.ClickRestoreButton();
            ChangeSignatureDialog.ClickOK();
            ChangeSignatureDialog.VerifyClosed();
            var actualText = VisualStudio.Editor.GetText();

            Assert.Contains(@"x.Method(""str"")", actualText);
            VisualStudio.SolutionExplorer.OpenFile(csharpProject, "Class1.cs");
            actualText = VisualStudio.Editor.GetText();
            var expectedText = @"
public class CSharpClass
{
    /// <summary>
    /// A method in CSharp.
    /// </summary>
    /// <param name=""b"">parameter b</param>
    /// 
    /// 
    /// <returns>One</returns>
    public int Method(string b)
    {
        return 1;
    }
}";

            Assert.Contains(expectedText, actualText);
        }
Пример #11
0
 public void OpenFile(ProjectUtils.Project project, string fileName)
 => _inProc.OpenFile(project.Name, fileName);
Пример #12
0
 public void BeginWatchForCodingConventionsChange(ProjectUtils.Project project, string fileName)
 => _inProc.BeginWatchForCodingConventionsChange(project.Name, fileName);
Пример #13
0
 public static void SetOptionInfer(this AbstractIntegrationTest test, ProjectUtils.Project project, bool value)
 {
     test.VisualStudio.Instance.VisualStudioWorkspace.SetOptionInfer(project.Name, value);
     test.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
            public void FileContents(ProjectUtils.Project project, string fileName, string expectedContents)
            {
                var actualContents = _solutionExplorer.GetFileContents(project, fileName);

                Assert.Equal(expectedContents, actualContents);
            }
Пример #15
0
 public void AddProject(ProjectUtils.Project projectName, string projectTemplate, string languageName)
 {
     _inProc.AddProject(projectName.Name, projectTemplate, languageName);
     _instance.Workspace.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
Пример #16
0
 public void SetFileContents(ProjectUtils.Project project, string fileName, string contents)
 => _inProc.SetFileContents(project.Name, fileName, contents);
Пример #17
0
 public void AddCustomProject(ProjectUtils.Project projectName, string projectFileExtension, string projectFileContent)
 {
     _inProc.AddCustomProject(projectName.Name, projectFileExtension, projectFileContent);
     _instance.Workspace.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
Пример #18
0
 public string GetFileContents(ProjectUtils.Project project, string fileName)
 => _inProc.GetFileContents(project.Name, fileName);
Пример #19
0
 public void RemoveProjectReference(ProjectUtils.Project projectName, ProjectUtils.ProjectReference projectReferenceName)
 {
     _inProc.RemoveProjectReference(projectName.Name, projectReferenceName.Name);
     _instance.Workspace.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
Пример #20
0
 public void OpenFileWithDesigner(ProjectUtils.Project project, string fileName)
 => _inProc.OpenFileWithDesigner(project.Name, fileName);
Пример #21
0
 public void RemoveMetadataReference(ProjectUtils.AssemblyReference assemblyName, ProjectUtils.Project projectName)
 {
     _inProc.RemoveMetadataReference(assemblyName.Name, projectName.Name);
     _instance.Workspace.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
Пример #22
0
 public void OpenFile(ProjectUtils.Project project, string fileName)
 {
     // Wireup to open files can happen asynchronously in the case we're being notified of changes on background threads.
     _inProc.OpenFile(project.Name, fileName);
     _instance.Workspace.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
Пример #23
0
 /// <summary>
 /// Remove a PackageReference from the specified project. Generally this should be followed up by
 /// a call to <see cref="RestoreNuGetPackages"/>.
 /// </summary>
 public void RemovePackageReference(ProjectUtils.Project project, ProjectUtils.PackageReference package)
 => _inProc.RemovePackageReference(project.Name, package.Name);
Пример #24
0
 public void ReloadProject(ProjectUtils.Project project)
 => _inProc.ReloadProject(project.RelativePath);
Пример #25
0
 public void RenameFileViaDTE(ProjectUtils.Project project, string oldFileName, string newFileName)
 {
     // Wireup to open files can happen asynchronously in the case we're being notified of changes on background threads.
     _inProc.RenameFileViaDTE(project.Name, oldFileName, newFileName);
     _instance.Workspace.WaitForAsyncOperations(Helper.HangMitigatingTimeout, FeatureAttribute.Workspace);
 }
Пример #26
0
 public void UnloadProject(ProjectUtils.Project project)
 => _inProc.UnloadProject(project.Name);
Пример #27
0
 public void SaveFile(ProjectUtils.Project project, string fileName)
 => _inProc.SaveFile(project.Name, fileName);
Пример #28
0
 public string[] GetAssemblyReferences(ProjectUtils.Project project)
 => _inProc.GetAssemblyReferences(project.Name);
Пример #29
0
 public void EditProjectFile(ProjectUtils.Project project)
 => _inProc.EditProjectFile(project.Name);
Пример #30
0
 public void RemoveAnalyzerReference(string filePath, ProjectUtils.Project projectName)
 {
     _inProc.RemoveAnalyzerReference(filePath, projectName.Name);
     _instance.Workspace.WaitForAsyncOperations(Helper.HangMitigatingTimeout, FeatureAttribute.Workspace);
 }