Update tool tests to target netcoreapp2.1
This commit is contained in:
parent
dc4046ca7e
commit
60e5fabde2
6 changed files with 27 additions and 10 deletions
|
@ -8,6 +8,7 @@ using Microsoft.DotNet.TestFramework;
|
||||||
using Microsoft.DotNet.Tools.Test.Utilities;
|
using Microsoft.DotNet.Tools.Test.Utilities;
|
||||||
using NuGet.Frameworks;
|
using NuGet.Frameworks;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
using Microsoft.DotNet.Tools.Tests.Utilities;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Cli.Utils.Tests
|
namespace Microsoft.DotNet.Cli.Utils.Tests
|
||||||
{
|
{
|
||||||
|
@ -189,7 +190,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
||||||
.Should().Pass();
|
.Should().Pass();
|
||||||
|
|
||||||
var factory = new ProjectDependenciesCommandFactory(
|
var factory = new ProjectDependenciesCommandFactory(
|
||||||
FrameworkConstants.CommonFrameworks.NetCoreApp20,
|
NuGetFrameworks.NetCoreApp21,
|
||||||
configuration,
|
configuration,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
|
|
|
@ -11,6 +11,7 @@ using Microsoft.DotNet.TestFramework;
|
||||||
using Microsoft.DotNet.Tools.Test.Utilities;
|
using Microsoft.DotNet.Tools.Test.Utilities;
|
||||||
using NuGet.Frameworks;
|
using NuGet.Frameworks;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
using Microsoft.DotNet.Tools.Tests.Utilities;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Cli.Utils.Tests
|
namespace Microsoft.DotNet.Cli.Utils.Tests
|
||||||
{
|
{
|
||||||
|
@ -47,7 +48,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
||||||
CommandName = "dotnet-portable",
|
CommandName = "dotnet-portable",
|
||||||
Configuration = "Debug",
|
Configuration = "Debug",
|
||||||
ProjectDirectory = MSBuildTestProjectInstance.Root.FullName,
|
ProjectDirectory = MSBuildTestProjectInstance.Root.FullName,
|
||||||
Framework = FrameworkConstants.CommonFrameworks.NetCoreApp20
|
Framework = NuGetFrameworks.NetCoreApp21
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = projectDependenciesCommandResolver.Resolve(commandResolverArguments);
|
var result = projectDependenciesCommandResolver.Resolve(commandResolverArguments);
|
||||||
|
@ -83,7 +84,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
||||||
CommandName = "dotnet-portable",
|
CommandName = "dotnet-portable",
|
||||||
Configuration = "Debug",
|
Configuration = "Debug",
|
||||||
ProjectDirectory = MSBuildTestProjectInstance.Root.FullName,
|
ProjectDirectory = MSBuildTestProjectInstance.Root.FullName,
|
||||||
Framework = FrameworkConstants.CommonFrameworks.NetCoreApp20
|
Framework = NuGetFrameworks.NetCoreApp21
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = projectDependenciesCommandResolver.Resolve(commandResolverArguments);
|
var result = projectDependenciesCommandResolver.Resolve(commandResolverArguments);
|
||||||
|
@ -109,7 +110,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
||||||
CommandName = "nonexistent-command",
|
CommandName = "nonexistent-command",
|
||||||
CommandArguments = null,
|
CommandArguments = null,
|
||||||
ProjectDirectory = MSBuildTestProjectInstance.Root.FullName,
|
ProjectDirectory = MSBuildTestProjectInstance.Root.FullName,
|
||||||
Framework = FrameworkConstants.CommonFrameworks.NetCoreApp20
|
Framework = NuGetFrameworks.NetCoreApp21
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = projectDependenciesCommandResolver.Resolve(commandResolverArguments);
|
var result = projectDependenciesCommandResolver.Resolve(commandResolverArguments);
|
||||||
|
@ -135,7 +136,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
||||||
CommandName = "dotnet-portable",
|
CommandName = "dotnet-portable",
|
||||||
Configuration = "Debug",
|
Configuration = "Debug",
|
||||||
ProjectDirectory = testInstance.Root.FullName,
|
ProjectDirectory = testInstance.Root.FullName,
|
||||||
Framework = FrameworkConstants.CommonFrameworks.NetCoreApp20,
|
Framework = NuGetFrameworks.NetCoreApp21,
|
||||||
OutputPath = outputDir.FullName
|
OutputPath = outputDir.FullName
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -12,13 +12,14 @@ using NuGet.Frameworks;
|
||||||
using NuGet.ProjectModel;
|
using NuGet.ProjectModel;
|
||||||
using NuGet.Versioning;
|
using NuGet.Versioning;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
using Microsoft.DotNet.Tools.Tests.Utilities;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Tests
|
namespace Microsoft.DotNet.Tests
|
||||||
{
|
{
|
||||||
public class GivenAProjectToolsCommandResolver : TestBase
|
public class GivenAProjectToolsCommandResolver : TestBase
|
||||||
{
|
{
|
||||||
private static readonly NuGetFramework s_toolPackageFramework =
|
private static readonly NuGetFramework s_toolPackageFramework =
|
||||||
FrameworkConstants.CommonFrameworks.NetCoreApp20;
|
NuGetFrameworks.NetCoreApp21;
|
||||||
|
|
||||||
private const string TestProjectName = "AppWithToolDependency";
|
private const string TestProjectName = "AppWithToolDependency";
|
||||||
|
|
||||||
|
@ -309,7 +310,7 @@ namespace Microsoft.DotNet.Tests
|
||||||
|
|
||||||
result.Should().NotBeNull();
|
result.Should().NotBeNull();
|
||||||
|
|
||||||
result.Args.Should().Contain("--fx-version 2.0.0");
|
result.Args.Should().Contain("--fx-version 2.1.0");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
using NuGet.Frameworks;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Microsoft.DotNet.Tools.Tests.Utilities
|
||||||
|
{
|
||||||
|
// This class is for frameworks that aren't yet in NuGet's FrameworkConstants.CommonFrameworks class
|
||||||
|
public static class NuGetFrameworks
|
||||||
|
{
|
||||||
|
public static readonly NuGetFramework NetCoreApp21
|
||||||
|
= new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCoreApp, new Version(2, 1, 0, 0));
|
||||||
|
}
|
||||||
|
}
|
|
@ -105,7 +105,7 @@ namespace Microsoft.DotNet.New.Tests
|
||||||
var sharedFxDir = dotnetDir
|
var sharedFxDir = dotnetDir
|
||||||
.GetDirectory("shared", "Microsoft.NETCore.App")
|
.GetDirectory("shared", "Microsoft.NETCore.App")
|
||||||
.EnumerateDirectories()
|
.EnumerateDirectories()
|
||||||
.Single(d => d.Name.StartsWith("2.0.0"));
|
.Single(d => d.Name.StartsWith("2.1.0"));
|
||||||
|
|
||||||
if (packageName == "microsoft.netcore.app")
|
if (packageName == "microsoft.netcore.app")
|
||||||
{
|
{
|
||||||
|
|
|
@ -246,8 +246,8 @@ namespace Microsoft.DotNet.Tests
|
||||||
.CreateInstance()
|
.CreateInstance()
|
||||||
.WithSourceFiles()
|
.WithSourceFiles()
|
||||||
.WithRestoreFiles();
|
.WithRestoreFiles();
|
||||||
|
|
||||||
const string framework = ".NETCoreApp,Version=v2.0";
|
string framework = Tools.Tests.Utilities.NuGetFrameworks.NetCoreApp21.DotNetFrameworkName;
|
||||||
|
|
||||||
new BuildCommand()
|
new BuildCommand()
|
||||||
.WithProjectDirectory(testInstance.Root)
|
.WithProjectDirectory(testInstance.Root)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue