-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathRestoreWithOlderNuGet.cs
41 lines (36 loc) · 1.37 KB
/
RestoreWithOlderNuGet.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace Microsoft.NET.Restore.Tests
{
public class RestoreWithOlderNuGet : SdkTest
{
public RestoreWithOlderNuGet(ITestOutputHelper log) : base(log)
{
}
[WindowsOnlyFact]
public void ItCanBuildProjectRestoredWithNuGet5_7()
{
var testProject = new TestProject()
{
TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
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)
{
NuGetExeVersion = "5.7.0"
};
restoreCommand
// Workaround for CI machines where MSBuild workload resolver isn't enabled by default
.WithEnvironmentVariable("MSBuildEnableWorkloadResolver", "false")
.Execute()
.Should()
.Pass();
new BuildCommand(testAsset)
.ExecuteWithoutRestore()
.Should()
.Pass();
}
}
}