-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix building projects restored with NuGet 5.7
- Loading branch information
1 parent
c427c6f
commit e3b75e1
Showing
4 changed files
with
98 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/Tests/Microsoft.NET.Restore.Tests/RestoreWithOlderNuGet.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright (c) .NET Foundation and contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
// | ||
|
||
using FluentAssertions; | ||
using Microsoft.NET.TestFramework; | ||
using Microsoft.NET.TestFramework.Assertions; | ||
using Microsoft.NET.TestFramework.Commands; | ||
using Microsoft.NET.TestFramework.ProjectConstruction; | ||
using NuGet.Common; | ||
using NuGet.Packaging; | ||
using NuGet.Packaging.Core; | ||
using System.IO; | ||
using System.Threading; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace Microsoft.NET.Restore.Tests | ||
{ | ||
public class RestoreWithOlderNuGet : SdkTest | ||
{ | ||
public RestoreWithOlderNuGet(ITestOutputHelper log) : base(log) | ||
{ | ||
} | ||
|
||
[Fact] | ||
public void ItCanBuildProjectRestoredWithNuGet5_7() | ||
{ | ||
var testProject = new TestProject() | ||
{ | ||
TargetFrameworks = "netcoreapp3.1", | ||
IsSdkProject = true | ||
}; | ||
testProject.PackageReferences.Add(new TestPackageReference("Humanizer.Core", "2.8.26")); | ||
|
||
var testAsset = _testAssetsManager.CreateTestProject(testProject); | ||
|
||
var restoreCommand = new NuGetExeRestoreCommand(Log, testAsset.Path, testProject.Name); | ||
restoreCommand.NuGetExeVersion = "5.7.0"; | ||
restoreCommand.Execute() | ||
.Should() | ||
.Pass(); | ||
|
||
new BuildCommand(testAsset) | ||
.ExecuteWithoutRestore() | ||
.Should() | ||
.Pass(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters