remove test that aserts .NET Standard should be prefered over .NET Framework

上级 96edea5a
......@@ -274,21 +274,6 @@ public async Task TestOpenProject_NetCoreMultiTFM_ProjectReference()
await AssertNetCoreMultiTFMProject(projectFilePath);
}
[ConditionalFact(typeof(VisualStudioMSBuildInstalled), typeof(DotNetCoreSdk.IsAvailable), AlwaysSkip = "https://github.com/dotnet/roslyn/issues/42772")]
[Trait(Traits.Feature, Traits.Features.MSBuildWorkspace)]
[Trait(Traits.Feature, Traits.Features.NetCore)]
public async Task TestOpenProject_NetCoreMultiTFM_ProjectReferenceWithReversedTFMs()
{
CreateFiles(GetNetCoreMultiTFMFiles_ProjectReferenceWithReversedTFMs());
// Restoring for Project.csproj should also restore Library.csproj
DotNetRestore(@"Project\Project.csproj");
var projectFilePath = GetSolutionFileName(@"Project\Project.csproj");
await AssertNetCoreMultiTFMProject(projectFilePath);
}
private static async Task AssertNetCoreMultiTFMProject(string projectFilePath)
{
using (var workspace = CreateMSBuildWorkspace())
......
using System;
namespace NetCoreApp2
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
</PropertyGroup>
</Project>
using System;
namespace NetCoreApp2
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Library\Library.csproj" />
</ItemGroup>
</Project>
......@@ -145,8 +145,6 @@ public static class CSharp
public static string NetCoreMultiTFM_ProjectReference_Library => GetText("NetCoreMultiTFM_ProjectReference.Library.csproj");
public static string NetCoreMultiTFM_ProjectReference_Project => GetText("NetCoreMultiTFM_ProjectReference.Project.csproj");
public static string NetCoreMultiTFM_ProjectReferenceToFSharp_CSharpLib = GetText("NetCoreMultiTFM_ProjectReferenceToFSharp.csharplib.csharplib.csproj");
public static string NetCoreMultiTFM_ProjectReferenceWithReversedTFMs_Library => GetText("NetCoreMultiTFM_ProjectReferenceWithReversedTFMs.Library.csproj");
public static string NetCoreMultiTFM_ProjectReferenceWithReversedTFMs_Project => GetText("NetCoreMultiTFM_ProjectReferenceWithReversedTFMs.Project.csproj");
public static string PortableProject => GetText("ProjectFiles.CSharp.PortableProject.csproj");
public static string ProjectLoadErrorOnMissingDebugType => GetText("ProjectFiles.CSharp.ProjectLoadErrorOnMissingDebugType.csproj");
public static string ProjectReference => GetText("ProjectFiles.CSharp.ProjectReference.csproj");
......@@ -207,8 +205,6 @@ public static class CSharp
public static string NetCoreMultiTFM_ProjectReference_Class1 => GetText("NetCoreMultiTFM_ProjectReference.Class1.cs");
public static string NetCoreMultiTFM_ProjectReference_Program => GetText("NetCoreMultiTFM_ProjectReference.Program.cs");
public static string NetCoreMultiTFM_ProjectReferenceToFSharp_CSharpLib_Class1 = GetText("NetCoreMultiTFM_ProjectReferenceToFSharp.csharplib.Class1.cs");
public static string NetCoreMultiTFM_ProjectReferenceWithReversedTFMs_Class1 => GetText("NetCoreMultiTFM_ProjectReferenceWithReversedTFMs.Class1.cs");
public static string NetCoreMultiTFM_ProjectReferenceWithReversedTFMs_Program => GetText("NetCoreMultiTFM_ProjectReferenceWithReversedTFMs.Program.cs");
public static string MainWindow => GetText("SourceFiles.CSharp.MainWindow.xaml.cs");
public static string OtherStuff_Foo => GetText("SourceFiles.CSharp.OtherStuff_Foo.cs");
}
......
......@@ -34,13 +34,6 @@ public string GetSolutionFileName(string relativeFileName)
return Path.Combine(this.SolutionDirectory.Path, relativeFileName);
}
protected void CreateFiles(params string[] fileNames)
{
var fileNamesAndContent = Array.ConvertAll(fileNames, fileName => (fileName, (object)Resources.GetText(fileName)));
var fileSet = new FileSet(fileNamesAndContent);
CreateFiles(fileSet);
}
protected void CreateFiles(IEnumerable<(string filePath, object fileContent)> fileNamesAndContent)
{
foreach (var (filePath, fileContent) in fileNamesAndContent)
......@@ -177,18 +170,6 @@ protected static FileSet GetNetCoreMultiTFMFiles_ProjectReference()
(@"Library\Class1.cs", Resources.SourceFiles.CSharp.NetCoreMultiTFM_ProjectReference_Class1));
}
protected static FileSet GetNetCoreMultiTFMFiles_ProjectReferenceWithReversedTFMs()
{
return new FileSet(
(@"NuGet.Config", Resources.NuGet_Config),
(@"Directory.Build.props", Resources.Directory_Build_props),
(@"Directory.Build.targets", Resources.Directory_Build_targets),
(@"Project\Project.csproj", Resources.ProjectFiles.CSharp.NetCoreMultiTFM_ProjectReferenceWithReversedTFMs_Project),
(@"Project\Program.cs", Resources.SourceFiles.CSharp.NetCoreMultiTFM_ProjectReferenceWithReversedTFMs_Program),
(@"Library\Library.csproj", Resources.ProjectFiles.CSharp.NetCoreMultiTFM_ProjectReferenceWithReversedTFMs_Library),
(@"Library\Class1.cs", Resources.SourceFiles.CSharp.NetCoreMultiTFM_ProjectReferenceWithReversedTFMs_Class1));
}
protected static FileSet GetNetCoreMultiTFMFiles_ProjectReferenceToFSharp()
{
return new FileSet(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册