提交 a930d92d 编写于 作者: Š Šimon Koníček

Running integration tests that use a project template in the existing C# file...

Running integration tests that use a project template in the existing C# file as opposed to creating a new one
上级 9413f0d7
......@@ -16,12 +16,13 @@ public CSharpUpdateProjectToAllowUnsafe(VisualStudioInstanceFactory instanceFact
{
}
private void InvokeFixFromNewFile(ProjectUtils.Project project)
private void InvokeFix()
{
VisualStudio.SolutionExplorer.AddFile(project, "C.cs", @"
VisualStudio.Editor.SetText(@"
unsafe class C
{
}", open: true);
}");
VisualStudio.Editor.Activate();
VisualStudio.Editor.PlaceCaret("C");
VisualStudio.Editor.InvokeCodeActionList();
......@@ -36,7 +37,7 @@ public void CPSProject_GeneralPropertyGroupUpdated()
VisualStudio.SolutionExplorer.CreateSolution(SolutionName);
VisualStudio.SolutionExplorer.AddProject(project, WellKnownProjectTemplates.CSharpNetStandardClassLibrary, LanguageNames.CSharp);
InvokeFixFromNewFile(project);
InvokeFix();
VerifyPropertyOutsideConfiguration(GetProjectFileElement(project), "AllowUnsafeBlocks", "true");
}
......@@ -48,7 +49,7 @@ public void LegacyProject_AllConfigurationsUpdated()
VisualStudio.SolutionExplorer.CreateSolution(SolutionName);
VisualStudio.SolutionExplorer.AddProject(project, WellKnownProjectTemplates.ClassLibrary, LanguageNames.CSharp);
InvokeFixFromNewFile(project);
InvokeFix();
VerifyPropertyInEachConfiguration(GetProjectFileElement(project), "AllowUnsafeBlocks", "true");
}
......@@ -94,7 +95,9 @@ public void LegacyProject_MultiplePlatforms_AllConfigurationsUpdated()
<Import Project=""$(MSBuildToolsPath)\Microsoft.CSharp.targets"" />
</Project>");
InvokeFixFromNewFile(project);
VisualStudio.SolutionExplorer.AddFile(project, "C.cs", open: true);
InvokeFix();
VerifyPropertyInEachConfiguration(GetProjectFileElement(project), "AllowUnsafeBlocks", "true");
}
}
......
......@@ -16,11 +16,12 @@ public CSharpUpgradeProject(VisualStudioInstanceFactory instanceFactory) : base(
{
}
private void InvokeFixFromNewFile(ProjectUtils.Project project)
private void InvokeFix()
{
VisualStudio.SolutionExplorer.AddFile(project, "C.cs", @"
VisualStudio.Editor.SetText(@"
#error version:latest
", open: true);
");
VisualStudio.Editor.Activate();
VisualStudio.Editor.PlaceCaret("version:latest");
VisualStudio.Editor.InvokeCodeActionList();
......@@ -35,7 +36,7 @@ public void CPSProject_GeneralPropertyGroupUpdated()
VisualStudio.SolutionExplorer.CreateSolution(SolutionName);
VisualStudio.SolutionExplorer.AddProject(project, WellKnownProjectTemplates.CSharpNetStandardClassLibrary, LanguageNames.CSharp);
InvokeFixFromNewFile(project);
InvokeFix();
VerifyPropertyOutsideConfiguration(GetProjectFileElement(project), "LangVersion", "latest");
}
......@@ -47,7 +48,7 @@ public void LegacyProject_AllConfigurationsUpdated()
VisualStudio.SolutionExplorer.CreateSolution(SolutionName);
VisualStudio.SolutionExplorer.AddProject(project, WellKnownProjectTemplates.ClassLibrary, LanguageNames.CSharp);
InvokeFixFromNewFile(project);
InvokeFix();
VerifyPropertyInEachConfiguration(GetProjectFileElement(project), "LangVersion", "latest");
}
......@@ -93,7 +94,9 @@ public void LegacyProject_MultiplePlatforms_AllConfigurationsUpdated()
<Import Project=""$(MSBuildToolsPath)\Microsoft.CSharp.targets"" />
</Project>");
InvokeFixFromNewFile(project);
VisualStudio.SolutionExplorer.AddFile(project, "C.cs", open: true);
InvokeFix();
VerifyPropertyInEachConfiguration(GetProjectFileElement(project), "LangVersion", "latest");
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册