Merge pull request #59 from nunit/issue-57
Add one VB and one F# test and make them work
This commit is contained in:
Коммит
e32be0e10c
|
@ -76,7 +76,7 @@ namespace NUnit.Engine.Services.ProjectLoaders
|
|||
|
||||
public bool CanLoadFrom(string path)
|
||||
{
|
||||
return IsProjectFile(path)|| IsSolutionFile(path);
|
||||
return IsProjectFile(path) || IsSolutionFile(path);
|
||||
}
|
||||
|
||||
public IProject LoadFrom(string path)
|
||||
|
@ -97,18 +97,19 @@ namespace NUnit.Engine.Services.ProjectLoaders
|
|||
{
|
||||
var project = new VSProject(path);
|
||||
var doc = CreateProjectDocument(path);
|
||||
var ext = Path.GetExtension(path);
|
||||
|
||||
switch (Path.GetExtension(path))
|
||||
switch (ext)
|
||||
{
|
||||
case ".csproj":
|
||||
case ".fsproj":
|
||||
case ".vbproj":
|
||||
if (!project.TryLoadLegacyProject(doc))
|
||||
if (!project.TryLoadSdkProject(doc))
|
||||
project.LoadNonSdkProject(doc);
|
||||
break;
|
||||
|
||||
case ".vbproj":
|
||||
case ".vjsproj":
|
||||
case ".fsproj":
|
||||
if (!project.TryLoadLegacyProject(doc))
|
||||
project.LoadNonSdkProject(doc);
|
||||
break;
|
||||
|
@ -118,7 +119,7 @@ namespace NUnit.Engine.Services.ProjectLoaders
|
|||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
throw new Exception($"Unsupported project type: '{ext}'");
|
||||
}
|
||||
|
||||
return project;
|
||||
|
|
|
@ -78,7 +78,13 @@ namespace NUnit.Engine.Services.ProjectLoaders.Tests
|
|||
new ProjectData("sdk-netstandard2.0-minimal-dll.csproj")
|
||||
.RuntimeDirectory("netstandard2.0"),
|
||||
new ProjectData("sdk-netstandard2.0-minimal-exe.csproj")
|
||||
.RuntimeDirectory("netstandard2.0")
|
||||
.RuntimeDirectory("netstandard2.0"),
|
||||
new ProjectData("sdk-net5.0-minimal-exe.fsproj")
|
||||
.WithConfig("Debug", "bin/Debug/net5.0/sdk-net5.0-minimal-exe.exe")
|
||||
.WithConfig("Release", "bin/Release/net5.0/sdk-net5.0-minimal-exe.exe"),
|
||||
new ProjectData("sdk-net5.0-minimal-exe.vbproj")
|
||||
.WithConfig("Debug", "bin/Debug/net5.0/sdk-net5.0-minimal-exe.exe")
|
||||
.WithConfig("Release", "bin/Release/net5.0/sdk-net5.0-minimal-exe.exe")
|
||||
};
|
||||
|
||||
[TestCaseSource(nameof(SdkProjects))]
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.fs" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>VBConsoleApp</RootNamespace>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
|
@ -74,4 +74,8 @@
|
|||
<EmbeddedResource Include="resources\sdk-netstandard2.0-minimal-exe.csproj" />
|
||||
<EmbeddedResource Include="resources\nonsdk-duplicated-key.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="resources\sdk-net5.0-minimal-exe.fsproj" />
|
||||
<EmbeddedResource Include="resources\sdk-net5.0-minimal-exe.vbproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
Загрузка…
Ссылка в новой задаче