Skip to content

Commit

Permalink
Remove unneeded test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkl committed Oct 10, 2023
1 parent f18a31c commit edfe819
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions test/NuGet.Core.Tests/NuGet.Build.Tasks.Test/RestoreTaskExTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,59 +82,6 @@ IEnumerable<string> GetExpectedArguments(string msbuildBinPath, string projectPa
}
}

/// <summary>
/// Verifies that when the values contained in global properties will exceed the maximum command line length, <see cref="StaticGraphRestoreTaskBase.GetCommandLineArguments(Dictionary{string, string})"/> leaves the global properties are out of the command line arguments and sets <see cref="StaticGraphRestoreTaskBase.SerializeGlobalProperties" /> to <see langword="true" />.
/// </summary>
[Fact]
public void GetCommandLineArguments_WhenLotsOfGlobalProperties_SerializeGlobalPropertiesSetToTrue()
{
using (var testDirectory = TestDirectory.Create())
{
string msbuildBinPath = Path.Combine(testDirectory, "MSBuild", "Current", "Bin");
string projectPath = Path.Combine(testDirectory, "src", "project1", "project1.csproj");

var globalProperties = new Dictionary<string, string>(100);

for (int i = 0; i < 100; i++)
{
globalProperties.Add($"Property{i}", new string('A', 100));
}

var buildEngine = new TestBuildEngine(globalProperties);

using (var task = new RestoreTaskEx
{
BuildEngine = buildEngine,
MSBuildBinPath = msbuildBinPath,
MSBuildStartupDirectory = testDirectory,
ProjectFullPath = projectPath,
SerializeGlobalProperties = false,
})
{
string arguments = task.GetCommandLineArguments(globalProperties);

arguments.Should().Be(StaticGraphRestoreTaskBase.CreateArgumentString(GetExpectedArguments(msbuildBinPath, projectPath)));

task.SerializeGlobalProperties.Should().BeTrue();
}
}

IEnumerable<string> GetExpectedArguments(string msbuildBinPath, string projectPath)
{
#if IS_CORECLR
yield return Path.ChangeExtension(typeof(RestoreTaskEx).Assembly.Location, ".Console.dll");
#endif
yield return "Recursive=False;CleanupAssetsForUnsupportedProjects=True;DisableParallel=False;Force=False;ForceEvaluate=False;HideWarningsAndErrors=False;IgnoreFailedSources=False;Interactive=False;NoCache=False;RestorePackagesConfig=False";
#if IS_CORECLR
yield return Path.Combine(msbuildBinPath, "MSBuild.dll");
#else
yield return Path.Combine(msbuildBinPath, "MSBuild.exe");
#endif
yield return projectPath;
}

}

/// <summary>
/// Verifies that the <see cref="RestoreTaskEx.GetGlobalProperties" /> returns the global properties plus any extra ones set by NuGet.
/// </summary>
Expand Down

0 comments on commit edfe819

Please sign in to comment.