Beispiel #1
0
 public void SetLanguageVersion(ProjectUtils.Project projectName, string languageVersion)
 {
     _inProc.SetLanguageVersion(projectName.Name, languageVersion);
     _instance.Workspace.WaitForAsyncOperations(Helper.HangMitigatingTimeout, FeatureAttribute.Workspace);
 }
 public void CloseCodeFile(ProjectUtils.Project project, string fileName, bool saveFile)
 => _inProc.CloseCodeFile(project.Name, fileName, saveFile);
 public void RestoreNuGetPackages(ProjectUtils.Project project)
 => _inProc.RestoreNuGetPackages(project.Name);
 /// <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);
 public void AddFile(ProjectUtils.Project project, string fileName, string contents = null, bool open = false)
 => _inProc.AddFile(project.Name, fileName, contents, open);
 public void AddProjectReference(ProjectUtils.Project fromProjectName, ProjectUtils.ProjectReference toProjectName)
 {
     _inProc.AddProjectReference(fromProjectName.Name, toProjectName.Name);
     _instance.Workspace.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
 public void AddMetadataReference(ProjectUtils.AssemblyReference fullyQualifiedAssemblyName, ProjectUtils.Project projectName)
 {
     _inProc.AddMetadataReference(fullyQualifiedAssemblyName.Name, projectName.Name);
     _instance.Workspace.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
 public void RenameFile(ProjectUtils.Project project, string oldFileName, string newFileName)
 => _inProc.RenameFile(project.Name, oldFileName, newFileName);
 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);
        }
 public void OpenFile(ProjectUtils.Project project, string fileName)
 => _inProc.OpenFile(project.Name, fileName);
Beispiel #12
0
 public void BeginWatchForCodingConventionsChange(ProjectUtils.Project project, string fileName)
 => _inProc.BeginWatchForCodingConventionsChange(project.Name, fileName);
Beispiel #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);
            }
 public void AddProject(ProjectUtils.Project projectName, string projectTemplate, string languageName)
 {
     _inProc.AddProject(projectName.Name, projectTemplate, languageName);
     _instance.Workspace.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
 public void SetFileContents(ProjectUtils.Project project, string fileName, string contents)
 => _inProc.SetFileContents(project.Name, fileName, contents);
 public void AddCustomProject(ProjectUtils.Project projectName, string projectFileExtension, string projectFileContent)
 {
     _inProc.AddCustomProject(projectName.Name, projectFileExtension, projectFileContent);
     _instance.Workspace.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
 public string GetFileContents(ProjectUtils.Project project, string fileName)
 => _inProc.GetFileContents(project.Name, fileName);
 public void RemoveProjectReference(ProjectUtils.Project projectName, ProjectUtils.ProjectReference projectReferenceName)
 {
     _inProc.RemoveProjectReference(projectName.Name, projectReferenceName.Name);
     _instance.Workspace.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
 public void OpenFileWithDesigner(ProjectUtils.Project project, string fileName)
 => _inProc.OpenFileWithDesigner(project.Name, fileName);
 public void RemoveMetadataReference(ProjectUtils.AssemblyReference assemblyName, ProjectUtils.Project projectName)
 {
     _inProc.RemoveMetadataReference(assemblyName.Name, projectName.Name);
     _instance.Workspace.WaitForAsyncOperations(FeatureAttribute.Workspace);
 }
 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);
 }
 /// <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);
 public void ReloadProject(ProjectUtils.Project project)
 => _inProc.ReloadProject(project.RelativePath);
 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);
 }
 public void UnloadProject(ProjectUtils.Project project)
 => _inProc.UnloadProject(project.Name);
 public void SaveFile(ProjectUtils.Project project, string fileName)
 => _inProc.SaveFile(project.Name, fileName);
 public string[] GetAssemblyReferences(ProjectUtils.Project project)
 => _inProc.GetAssemblyReferences(project.Name);
 public void EditProjectFile(ProjectUtils.Project project)
 => _inProc.EditProjectFile(project.Name);
Beispiel #30
0
 public void RemoveAnalyzerReference(string filePath, ProjectUtils.Project projectName)
 {
     _inProc.RemoveAnalyzerReference(filePath, projectName.Name);
     _instance.Workspace.WaitForAsyncOperations(Helper.HangMitigatingTimeout, FeatureAttribute.Workspace);
 }