diff --git a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Update.cs b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Update.cs
index 7475283f2a47..8f5d0850ef5f 100644
--- a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Update.cs
+++ b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Update.cs
@@ -32,77 +32,77 @@ public async Task WithSolution()
],
[
("path/to/solution.sln", """
- Microsoft Visual Studio Solution File, Format Version 12.00
- # Visual Studio 14
- VisualStudioVersion = 14.0.22705.0
- MinimumVisualStudioVersion = 10.0.40219.1
- Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "my", "my.csproj", "{782E0C0A-10D3-444D-9640-263D03D2B20C}"
- EndProject
- Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {782E0C0A-10D3-444D-9640-263D03D2B20C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {782E0C0A-10D3-444D-9640-263D03D2B20C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {782E0C0A-10D3-444D-9640-263D03D2B20C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {782E0C0A-10D3-444D-9640-263D03D2B20C}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- EndGlobal
- """),
+ Microsoft Visual Studio Solution File, Format Version 12.00
+ # Visual Studio 14
+ VisualStudioVersion = 14.0.22705.0
+ MinimumVisualStudioVersion = 10.0.40219.1
+ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "my", "my.csproj", "{782E0C0A-10D3-444D-9640-263D03D2B20C}"
+ EndProject
+ Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {782E0C0A-10D3-444D-9640-263D03D2B20C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {782E0C0A-10D3-444D-9640-263D03D2B20C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {782E0C0A-10D3-444D-9640-263D03D2B20C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {782E0C0A-10D3-444D-9640-263D03D2B20C}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ EndGlobal
+ """),
("path/to/my.csproj", """
-
-
-
- v4.5
-
-
-
-
-
-
- packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll
- True
-
-
-
-
- """),
+
+
+
+ v4.5
+
+
+
+
+
+
+ packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll
+ True
+
+
+
+
+ """),
("path/to/packages.config", """
-
-
-
- """)
+
+
+
+ """)
],
[
("path/to/my.csproj", """
-
-
-
- v4.5
-
-
-
-
-
-
- packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll
- True
-
-
-
-
- """),
+
+
+
+ v4.5
+
+
+
+
+
+
+ packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll
+ True
+
+
+
+
+ """),
("path/to/packages.config", """
-
-
-
-
- """)
+
+
+
+
+ """)
]);
}
@@ -126,54 +126,54 @@ public async Task WithProject()
],
[
("path/to/my.csproj", """
-
-
-
- v4.5
-
-
-
-
-
-
- packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll
- True
-
-
-
-
- """),
+
+
+
+ v4.5
+
+
+
+
+
+
+ packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll
+ True
+
+
+
+
+ """),
("path/to/packages.config", """
-
-
-
- """)
+
+
+
+ """)
],
[
("path/to/my.csproj", """
-
-
-
- v4.5
-
-
-
-
-
-
- packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll
- True
-
-
-
-
- """),
+
+
+
+ v4.5
+
+
+
+
+
+
+ packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll
+ True
+
+
+
+
+ """),
("path/to/packages.config", """
-
-
-
-
- """)
+
+
+
+
+ """)
]);
}
@@ -233,7 +233,7 @@ public async Task WithDirsProjAndDirectoryBuildPropsThatIsOutOfDirectoryButStill
"""),
("other-dir/Directory.Build.props", """
-
+
@@ -280,7 +280,7 @@ public async Task WithDirsProjAndDirectoryBuildPropsThatIsOutOfDirectoryButStill
"""),
("other-dir/Directory.Build.props", """
-
+
diff --git a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/FrameworkCheckCommand.cs b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/FrameworkCheckCommand.cs
index f1927de12182..948e7d41efca 100644
--- a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/FrameworkCheckCommand.cs
+++ b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/FrameworkCheckCommand.cs
@@ -16,9 +16,7 @@ internal static Command GetCommand(Action setExitCode)
{
Command command = new("framework-check", "Checks that a project's target frameworks are satisfied by the target frameworks supported by a package.")
{
- ProjectTfmsOption,
- PackageTfmsOption,
- VerboseOption
+ ProjectTfmsOption, PackageTfmsOption, VerboseOption
};
command.TreatUnmatchedTokensAsErrors = true;
diff --git a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Program.cs b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Program.cs
index 6549831eba9b..830742ded050 100644
--- a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Program.cs
+++ b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Program.cs
@@ -13,11 +13,7 @@ internal static async Task Main(string[] args)
var exitCode = 0;
Action setExitCode = code => exitCode = code;
- var command = new RootCommand
- {
- FrameworkCheckCommand.GetCommand(setExitCode),
- UpdateCommand.GetCommand(setExitCode),
- };
+ var command = new RootCommand { FrameworkCheckCommand.GetCommand(setExitCode), UpdateCommand.GetCommand(setExitCode), };
command.TreatUnmatchedTokensAsErrors = true;
var result = await command.InvokeAsync(args);
diff --git a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/DotNetToolsJsonBuildFileTests.cs b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/DotNetToolsJsonBuildFileTests.cs
index 30d5339eb64f..f07d0990ef3d 100644
--- a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/DotNetToolsJsonBuildFileTests.cs
+++ b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/DotNetToolsJsonBuildFileTests.cs
@@ -38,11 +38,7 @@ public class DotnetToolsJsonBuildFileTests
[Fact]
public void GetDependencies_ReturnsDependencies()
{
- var expectedDependencies = new List
- {
- new("microsoft.botsay", "1.0.0", DependencyType.DotNetTool),
- new("dotnetsay", "2.1.3", DependencyType.DotNetTool)
- };
+ var expectedDependencies = new List { new("microsoft.botsay", "1.0.0", DependencyType.DotNetTool), new("dotnetsay", "2.1.3", DependencyType.DotNetTool) };
var buildFile = GetBuildFile();
diff --git a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/GlobalJsonBuildFileTests.cs b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/GlobalJsonBuildFileTests.cs
index d71ef9d5336e..b259319641cb 100644
--- a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/GlobalJsonBuildFileTests.cs
+++ b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/GlobalJsonBuildFileTests.cs
@@ -53,11 +53,7 @@ public void GlobalJson_NotJson_DoesNotThrow()
[Fact]
public void GlobalJson_GetDependencies_ReturnsDependencies()
{
- var expectedDependencies = new List
- {
- new("My.Custom.Sdk", "5.0.0", DependencyType.MSBuildSdk),
- new("My.Other.Sdk", "1.0.0-beta", DependencyType.MSBuildSdk)
- };
+ var expectedDependencies = new List { new("My.Custom.Sdk", "5.0.0", DependencyType.MSBuildSdk), new("My.Other.Sdk", "1.0.0-beta", DependencyType.MSBuildSdk) };
var buildFile = GetBuildFile(GlobalJson);
diff --git a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/ProjectBuildFileTests.cs b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/ProjectBuildFileTests.cs
index 3e66e3cc2fd4..d1ef9f6b531f 100644
--- a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/ProjectBuildFileTests.cs
+++ b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/ProjectBuildFileTests.cs
@@ -74,10 +74,7 @@ public void ProjectCsProj_GetDependencies_ReturnsDependencies()
[Fact]
public void ProjectCsProj_ReferencedProjectPaths_ReturnsPaths()
{
- var expectedReferencedProjectPaths = new List
- {
- "/Library/Library.csproj"
- };
+ var expectedReferencedProjectPaths = new List { "/Library/Library.csproj" };
var buildFile = GetBuildFile(ProjectCsProj, "Project.csproj");
@@ -107,11 +104,7 @@ public void DirectoryPackagesProps_GetDependencies_ReturnsDependencies()
[Fact]
public void DirectoryPackagesProps_Properties_ReturnsProperties()
{
- var expectedProperties = new List>
- {
- new("ManagePackageVersionsCentrally", "true"),
- new("CentralPackageTransitivePinningEnabled", "true")
- };
+ var expectedProperties = new List> { new("ManagePackageVersionsCentrally", "true"), new("CentralPackageTransitivePinningEnabled", "true") };
var buildFile = GetBuildFile(DirectoryPackagesProps, "Directory.Packages.props");
@@ -134,16 +127,16 @@ public void EmptyProject_GetDependencies_ReturnsNoDependencies()
[Theory]
[InlineData( // no change made
- @"path\to\file.dll",
- @"path\to\file.dll"
+ @"path\to\file.dll",
+ @"path\to\file.dll"
)]
[InlineData( // change from `/` to `\`
- "path/to/file.dll",
- @"path\to\file.dll"
+ "path/to/file.dll",
+ @"path\to\file.dll"
)]
[InlineData( // multiple changes made
- "path1/to1/file1.dllpath2/to2/file2.dll",
- @"path1\to1\file1.dllpath2\to2\file2.dll"
+ "path1/to1/file1.dllpath2/to2/file2.dll",
+ @"path1\to1\file1.dllpath2\to2\file2.dll"
)]
public void ReferenceHintPathsCanBeNormalized(string originalXml, string expectedXml)
{
diff --git a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/FrameworkChecker/SupportedFrameworkFacts.cs b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/FrameworkChecker/SupportedFrameworkFacts.cs
index 50336bba9150..38cfec321895 100644
--- a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/FrameworkChecker/SupportedFrameworkFacts.cs
+++ b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/FrameworkChecker/SupportedFrameworkFacts.cs
@@ -48,8 +48,10 @@ public class SupportedFrameworksFacts
Win10,
WinRt
];
+
// The following frameworks were included in NuGet.Client code but they were not official framework releases.
- private readonly HashSet UnofficialFrameworks = [
+ private readonly HashSet UnofficialFrameworks =
+ [
NetStandard17,
NetStandardApp15,
];
diff --git a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorker.DirsProj.cs b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorker.DirsProj.cs
index b82abd17defa..028679a5271d 100644
--- a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorker.DirsProj.cs
+++ b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorker.DirsProj.cs
@@ -24,7 +24,7 @@ public async Task UpdateSingleDependencyInDirsProj()
// initial
projectContents: """
-
+
@@ -34,22 +34,22 @@ public async Task UpdateSingleDependencyInDirsProj()
additionalFiles:
[
("src/test-project.csproj",
- """
-
-
- netstandard2.0
-
-
-
-
-
-
- """)
+ """
+
+
+ netstandard2.0
+
+
+
+
+
+
+ """)
],
// expected
expectedProjectContents: """
-
+
@@ -59,17 +59,17 @@ public async Task UpdateSingleDependencyInDirsProj()
additionalFilesExpected:
[
("src/test-project.csproj",
- """
-
-
- netstandard2.0
-
-
-
-
-
-
- """)
+ """
+
+
+ netstandard2.0
+
+
+
+
+
+
+ """)
]);
}
@@ -101,7 +101,7 @@ public async Task UpdateSingleDependencyInNestedDirsProj()
// initial
projectContents: """
-
+
@@ -111,32 +111,32 @@ public async Task UpdateSingleDependencyInNestedDirsProj()
additionalFiles:
[
("src/dirs.proj",
- """
-
-
-
-
-
-
-
- """),
+ """
+
+
+
+
+
+
+
+ """),
("src/test-project/test-project.csproj",
- """
-
-
- netstandard2.0
-
-
-
-
-
-
- """)
+ """
+
+
+ netstandard2.0
+
+
+
+
+
+
+ """)
],
// expected
expectedProjectContents: """
-
+
@@ -146,27 +146,27 @@ public async Task UpdateSingleDependencyInNestedDirsProj()
additionalFilesExpected:
[
("src/dirs.proj",
- """
-
-
-
-
-
-
-
- """),
+ """
+
+
+
+
+
+
+
+ """),
("src/test-project/test-project.csproj",
- """
-
-
- netstandard2.0
-
-
-
-
-
-
- """)
+ """
+
+
+ netstandard2.0
+
+
+
+
+
+
+ """)
]);
}
diff --git a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs
index 07f179ed159a..2ca0fd87601f 100644
--- a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs
+++ b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs
@@ -18,7 +18,8 @@ public abstract class UpdateWorkerTestBase
bool isTransitive = false,
(string Path, string Content)[]? additionalFiles = null,
string projectFilePath = "test-project.csproj")
- => TestUpdateForProject(dependencyName, oldVersion, newVersion, (projectFilePath, projectContents), expectedProjectContents: projectContents, isTransitive, additionalFiles, additionalFilesExpected: additionalFiles);
+ => TestUpdateForProject(dependencyName, oldVersion, newVersion, (projectFilePath, projectContents), expectedProjectContents: projectContents, isTransitive, additionalFiles,
+ additionalFilesExpected: additionalFiles);
protected static Task TestUpdateForProject(
string dependencyName,
diff --git a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.DotNetTools.cs b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.DotNetTools.cs
index c92fc0bcb34a..f1880e12a2c9 100644
--- a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.DotNetTools.cs
+++ b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.DotNetTools.cs
@@ -23,7 +23,7 @@ public async Task NoChangeWhenDotNetToolsJsonNotFound()
netstandard2.0
-
+
@@ -41,7 +41,7 @@ public async Task NoChangeWhenDependencyNotFound()
netstandard2.0
-
+
@@ -77,7 +77,7 @@ public async Task NoChangeWhenDotNetToolsJsonInUnexpectedLocation()
netstandard2.0
-
+
@@ -112,7 +112,7 @@ public async Task UpdateSingleDependencyInDirsProj()
netstandard2.0
-
+
@@ -147,7 +147,7 @@ public async Task UpdateSingleDependencyInDirsProj()
netstandard2.0
-
+
@@ -188,7 +188,7 @@ public async Task UpdateSingleDependencyWithComments()
netstandard2.0
-
+
@@ -225,7 +225,7 @@ public async Task UpdateSingleDependencyWithComments()
netstandard2.0
-
+
@@ -234,27 +234,27 @@ public async Task UpdateSingleDependencyWithComments()
additionalFilesExpected:
[
(".config/dotnet-tools.json", """
- {
- // this is a comment
- "version": 1,
- "isRoot": true,
- "tools": {
- "microsoft.botsay": {
- // this is a deep comment
- "version": "1.1.0",
- "commands": [
- "botsay"
- ]
- },
- "dotnetsay": {
- "version": "2.1.3",
- "commands": [
- "dotnetsay"
- ]
+ {
+ // this is a comment
+ "version": 1,
+ "isRoot": true,
+ "tools": {
+ "microsoft.botsay": {
+ // this is a deep comment
+ "version": "1.1.0",
+ "commands": [
+ "botsay"
+ ]
+ },
+ "dotnetsay": {
+ "version": "2.1.3",
+ "commands": [
+ "dotnetsay"
+ ]
+ }
}
}
- }
- """)
+ """)
]);
}
}
diff --git a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.GlobalJson.cs b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.GlobalJson.cs
index 816d62497e1d..458a63d2fc2b 100644
--- a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.GlobalJson.cs
+++ b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.GlobalJson.cs
@@ -23,7 +23,7 @@ public async Task NoChangeWhenGlobalJsonNotFound()
netstandard2.0
-
+
@@ -41,7 +41,7 @@ public async Task NoChangeWhenDependencyNotFound()
netstandard2.0
-
+
@@ -71,7 +71,7 @@ public async Task NoChangeWhenGlobalJsonInUnexpectedLocation()
netstandard2.0
-
+
>
@@ -104,7 +104,7 @@ public async Task UpdateSingleDependency()
netstandard2.0
-
+
@@ -130,7 +130,7 @@ public async Task UpdateSingleDependency()
netstandard2.0
-
+
@@ -162,7 +162,7 @@ public async Task UpdateDependencyWithComments()
netstandard2.0
-
+
@@ -190,7 +190,7 @@ public async Task UpdateDependencyWithComments()
netstandard2.0
-
+
diff --git a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs
index 2b4fe74e3f72..7d0116fe81fd 100644
--- a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs
+++ b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs
@@ -914,25 +914,20 @@ public async Task PackagesConfigUpdateCanHappenEvenWithMismatchedVersionNumbers(
(string Path, string Content)[]? additionalFiles = null,
(string Path, string Content)[]? additionalFilesExpected = null)
{
- var realizedAdditionalFiles = new List<(string Path, string Content)>
- {
- ("packages.config", packagesConfigContents),
- };
+ var realizedAdditionalFiles = new List<(string Path, string Content)> { ("packages.config", packagesConfigContents), };
if (additionalFiles is not null)
{
realizedAdditionalFiles.AddRange(additionalFiles);
}
- var realizedAdditionalFilesExpected = new List<(string Path, string Content)>
- {
- ("packages.config", expectedPackagesConfigContents),
- };
+ var realizedAdditionalFilesExpected = new List<(string Path, string Content)> { ("packages.config", expectedPackagesConfigContents), };
if (additionalFilesExpected is not null)
{
realizedAdditionalFilesExpected.AddRange(additionalFilesExpected);
}
- await TestUpdateForProject(dependencyName, oldVersion, newVersion, projectContents, expectedProjectContents, additionalFiles: realizedAdditionalFiles.ToArray(), additionalFilesExpected: realizedAdditionalFilesExpected.ToArray());
+ await TestUpdateForProject(dependencyName, oldVersion, newVersion, projectContents, expectedProjectContents, additionalFiles: realizedAdditionalFiles.ToArray(),
+ additionalFilesExpected: realizedAdditionalFilesExpected.ToArray());
}
}
}
diff --git a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.Sdk.cs b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.Sdk.cs
index fe640448aabc..4dea5d289c2a 100644
--- a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.Sdk.cs
+++ b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.Sdk.cs
@@ -30,7 +30,7 @@ public async Task UpdateVersionAttribute_InProjectFile_ForPackageReferenceInclud
{tfm}
-
+
@@ -42,7 +42,7 @@ public async Task UpdateVersionAttribute_InProjectFile_ForPackageReferenceInclud
{tfm}
-
+
@@ -81,7 +81,7 @@ public async Task UpdateFindsNearestNugetConfig_AndSucceeds()
var privateNugetContent = """
-
+
@@ -90,16 +90,16 @@ public async Task UpdateFindsNearestNugetConfig_AndSucceeds()
""";
await TestUpdateForProject("Newtonsoft.Json", "9.0.1", "13.0.1",
projectFile: (Path: "Directory/Project.csproj", Content: """
-
-
- netstandard2.0
-
-
-
-
-
- """),
- """
+
+
+ netstandard2.0
+
+
+
+
+
+ """),
+ """
netstandard2.0
@@ -109,7 +109,7 @@ public async Task UpdateFindsNearestNugetConfig_AndSucceeds()
""",
- additionalFiles:
+ additionalFiles:
[
(Path: "NuGet.config", Content: $"""
@@ -121,7 +121,7 @@ public async Task UpdateFindsNearestNugetConfig_AndSucceeds()
"""),
(Path: "Directory/NuGet.config", Content: privateNugetContent)
- ]);
+ ]);
}
[Fact]
@@ -140,7 +140,7 @@ public async Task UpdateReturnsEmptyArray_WhenBuildFails()
""",
- additionalFiles:
+ additionalFiles:
[
(Path: "NuGet.config", Content: """
@@ -168,7 +168,7 @@ public async Task UpdateExactMatchVersionAttribute_InProjectFile_ForPackageRefer
net6.0
-
+
@@ -180,7 +180,7 @@ public async Task UpdateExactMatchVersionAttribute_InProjectFile_ForPackageRefer
net6.0
-
+
@@ -196,11 +196,11 @@ public async Task AddPackageReference_InProjectFile_ForTransientDependency()
// initial
projectContents: """
-
+
netcoreapp3.1
-
+
@@ -210,11 +210,11 @@ public async Task AddPackageReference_InProjectFile_ForTransientDependency()
// expected
expectedProjectContents: """
-
+
netcoreapp3.1
-
+
@@ -235,7 +235,7 @@ public async Task UpdateVersionAttribute_InProjectFile_ForAnalyzerPackageReferen
netstandard2.0
-
+
all
@@ -250,7 +250,7 @@ public async Task UpdateVersionAttribute_InProjectFile_ForAnalyzerPackageReferen
netstandard2.0
-
+
all
@@ -272,7 +272,7 @@ public async Task UpdateVersionAttribute_InProjectFile_ForMultiplePackageReferen
netstandard2.0
-
+
@@ -285,7 +285,7 @@ public async Task UpdateVersionAttribute_InProjectFile_ForMultiplePackageReferen
netstandard2.0
-
+
@@ -305,7 +305,7 @@ public async Task UpdateVersionAttribute_InProjectFile_ForPackageReferenceUpdate
netstandard2.0
-
+
@@ -318,7 +318,7 @@ public async Task UpdateVersionAttribute_InProjectFile_ForPackageReferenceUpdate
netstandard2.0
-
+
@@ -338,7 +338,7 @@ public async Task UpdateVersionAttribute_InDirectoryPackages_ForPackageVersion()
netstandard2.0
-
+
@@ -351,7 +351,7 @@ public async Task UpdateVersionAttribute_InDirectoryPackages_ForPackageVersion()
true
-
+
@@ -364,7 +364,7 @@ public async Task UpdateVersionAttribute_InDirectoryPackages_ForPackageVersion()
netstandard2.0
-
+
@@ -377,7 +377,7 @@ public async Task UpdateVersionAttribute_InDirectoryPackages_ForPackageVersion()
true
-
+
@@ -397,7 +397,7 @@ public async Task UpdateExactMatchVersionAttribute_InDirectoryPackages_ForPackag
netstandard2.0
-
+
@@ -410,7 +410,7 @@ public async Task UpdateExactMatchVersionAttribute_InDirectoryPackages_ForPackag
true
-
+
@@ -423,7 +423,7 @@ public async Task UpdateExactMatchVersionAttribute_InDirectoryPackages_ForPackag
netstandard2.0
-
+
@@ -436,7 +436,7 @@ public async Task UpdateExactMatchVersionAttribute_InDirectoryPackages_ForPackag
true
-
+
@@ -456,7 +456,7 @@ public async Task UpdatePropertyValue_InProjectFile_ForPackageReferenceIncludeWi
netstandard2.0
9.0.1
-
+
@@ -469,7 +469,7 @@ public async Task UpdatePropertyValue_InProjectFile_ForPackageReferenceIncludeWi
netstandard2.0
13.0.1
-
+
@@ -488,7 +488,7 @@ public async Task UpdateDifferentCasedPropertyValue_InProjectFile_ForPackageRefe
netstandard2.0
9.0.1
-
+
@@ -501,7 +501,7 @@ public async Task UpdateDifferentCasedPropertyValue_InProjectFile_ForPackageRefe
netstandard2.0
13.0.1
-
+
@@ -520,7 +520,7 @@ public async Task UpdatePropertyValue_InProjectFile_ForPackageReferenceInclude()
netstandard2.0
9.0.1
-
+
@@ -533,7 +533,7 @@ public async Task UpdatePropertyValue_InProjectFile_ForPackageReferenceInclude()
netstandard2.0
13.0.1
-
+
@@ -552,7 +552,7 @@ public async Task UpdateExactMatchPropertyValue_InProjectFile_ForPackageReferenc
netstandard2.0
[9.0.1]
-
+
@@ -565,7 +565,7 @@ public async Task UpdateExactMatchPropertyValue_InProjectFile_ForPackageReferenc
netstandard2.0
[13.0.1]
-
+
@@ -584,7 +584,7 @@ public async Task UpdateVersionAttributeAndPropertyValue_InProjectFile_ForMultip
netstandard2.0
9.0.1
-
+
@@ -598,7 +598,7 @@ public async Task UpdateVersionAttributeAndPropertyValue_InProjectFile_ForMultip
netstandard2.0
13.0.1
-
+
@@ -618,7 +618,7 @@ public async Task UpdatePropertyValue_InProjectFile_ForPackageReferenceUpdate()
netstandard2.0
9.0.1
-
+
@@ -632,7 +632,7 @@ public async Task UpdatePropertyValue_InProjectFile_ForPackageReferenceUpdate()
netstandard2.0
13.0.1
-
+
@@ -652,7 +652,7 @@ public async Task UpdatePropertyValue_InDirectoryProps_ForPackageVersion()
netstandard2.0
-
+
@@ -666,7 +666,7 @@ public async Task UpdatePropertyValue_InDirectoryProps_ForPackageVersion()
true
9.0.1
-
+
@@ -679,7 +679,7 @@ public async Task UpdatePropertyValue_InDirectoryProps_ForPackageVersion()
netstandard2.0
-
+
@@ -693,7 +693,7 @@ public async Task UpdatePropertyValue_InDirectoryProps_ForPackageVersion()
true
13.0.1
-
+
@@ -713,7 +713,7 @@ public async Task UpdateExactMatchPropertyValue_InDirectoryProps_ForPackageVersi
netstandard2.0
-
+
@@ -727,7 +727,7 @@ public async Task UpdateExactMatchPropertyValue_InDirectoryProps_ForPackageVersi
true
[9.0.1]
-
+
@@ -740,7 +740,7 @@ public async Task UpdateExactMatchPropertyValue_InDirectoryProps_ForPackageVersi
netstandard2.0
-
+
@@ -754,7 +754,7 @@ public async Task UpdateExactMatchPropertyValue_InDirectoryProps_ForPackageVersi
true
[13.0.1]
-
+
@@ -774,7 +774,7 @@ public async Task UpdateVersionOverrideAttributeAndPropertyValue_InProjectFileAn
netstandard2.0
-
+
@@ -788,7 +788,7 @@ public async Task UpdateVersionOverrideAttributeAndPropertyValue_InProjectFileAn
true
9.0.1
-
+
@@ -801,7 +801,7 @@ public async Task UpdateVersionOverrideAttributeAndPropertyValue_InProjectFileAn
netstandard2.0
-
+
@@ -815,7 +815,7 @@ public async Task UpdateVersionOverrideAttributeAndPropertyValue_InProjectFileAn
true
13.0.1
-
+
@@ -844,7 +844,7 @@ public async Task UpdateVersionAttribute_InDirectoryProps_ForGlobalPackageRefere
true
-
+
@@ -866,7 +866,7 @@ public async Task UpdateVersionAttribute_InDirectoryProps_ForGlobalPackageRefere
true
-
+
@@ -896,7 +896,7 @@ public async Task UpdatePropertyValue_InDirectoryProps_ForGlobalPackageReference
true
9.0.1
-
+
@@ -919,7 +919,7 @@ public async Task UpdatePropertyValue_InDirectoryProps_ForGlobalPackageReference
true
13.0.1
-
+
@@ -938,7 +938,7 @@ public async Task UpdatePropertyValue_InDirectoryProps_ForPackageReferenceInclud
netstandard2.0
-
+
@@ -961,7 +961,7 @@ public async Task UpdatePropertyValue_InDirectoryProps_ForPackageReferenceInclud
netstandard2.0
-
+
@@ -988,11 +988,11 @@ public async Task UpdatePropertyValue_InProps_ForPackageReferenceInclude()
projectContents: """
-
+
netstandard2.0
-
+
@@ -1013,11 +1013,11 @@ public async Task UpdatePropertyValue_InProps_ForPackageReferenceInclude()
expectedProjectContents: """
-
+
netstandard2.0
-
+
@@ -1047,7 +1047,7 @@ public async Task UpdatePropertyValue_InProps_ForPackageVersion()
netstandard2.0
-
+
@@ -1062,7 +1062,7 @@ public async Task UpdatePropertyValue_InProps_ForPackageVersion()
true
-
+
@@ -1082,7 +1082,7 @@ public async Task UpdatePropertyValue_InProps_ForPackageVersion()
netstandard2.0
-
+
@@ -1097,7 +1097,7 @@ public async Task UpdatePropertyValue_InProps_ForPackageVersion()
true
-
+
@@ -1124,7 +1124,7 @@ public async Task UpdatePropertyValue_InProps_ThenSubstituted_ForPackageVersion(
netstandard2.0
-
+
@@ -1140,7 +1140,7 @@ public async Task UpdatePropertyValue_InProps_ThenSubstituted_ForPackageVersion(
true
$(NewtonsoftJsonVersion)
-
+
@@ -1160,7 +1160,7 @@ public async Task UpdatePropertyValue_InProps_ThenSubstituted_ForPackageVersion(
netstandard2.0
-
+
@@ -1176,7 +1176,7 @@ public async Task UpdatePropertyValue_InProps_ThenSubstituted_ForPackageVersion(
true
$(NewtonsoftJsonVersion)
-
+
@@ -1203,7 +1203,7 @@ public async Task UpdatePropertyValues_InProps_ThenRedefinedAndSubstituted_ForPa
netstandard2.0
-
+
@@ -1219,7 +1219,7 @@ public async Task UpdatePropertyValues_InProps_ThenRedefinedAndSubstituted_ForPa
true
$(NewtonsoftJsonVersion)
-
+
@@ -1240,7 +1240,7 @@ public async Task UpdatePropertyValues_InProps_ThenRedefinedAndSubstituted_ForPa
netstandard2.0
-
+
@@ -1256,7 +1256,7 @@ public async Task UpdatePropertyValues_InProps_ThenRedefinedAndSubstituted_ForPa
true
$(NewtonsoftJsonVersion)
-
+
@@ -1565,13 +1565,13 @@ public async Task AvoidPackageDowngradeWhenUpdatingDependency()
await TestUpdateForProject("Microsoft.VisualStudio.Sdk.TestFramework.Xunit", "17.2.7", "17.6.16",
projectContents: """
-
+
$(PreferredTargetFramework)
false
-
+
@@ -1613,13 +1613,13 @@ public async Task AvoidPackageDowngradeWhenUpdatingDependency()
],
expectedProjectContents: """
-
+
$(PreferredTargetFramework)
false
-
+
@@ -1668,11 +1668,11 @@ public async Task AddTransitiveDependencyByAddingPackageReferenceAndVersion()
// initial
projectContents: """
-
+
net5.0
-
+
@@ -1696,11 +1696,11 @@ public async Task AddTransitiveDependencyByAddingPackageReferenceAndVersion()
// expected
expectedProjectContents: """
-
+
net5.0
-
+
@@ -1732,12 +1732,12 @@ public async Task PinTransitiveDependencyByAddingPackageVersion()
// initial
projectContents: """
-
+
$(NoWarn);NETSDK1138
net5.0
-
+
@@ -1762,12 +1762,12 @@ public async Task PinTransitiveDependencyByAddingPackageVersion()
// expected
expectedProjectContents: """
-
+
$(NoWarn);NETSDK1138
net5.0
-
+
@@ -1797,15 +1797,15 @@ public async Task PropsFileNameWithDifferentCasing()
{
await TestUpdateForProject("Newtonsoft.Json", "12.0.1", "13.0.1",
projectContents: """
-
-
- net7.0
-
-
-
-
-
- """,
+
+
+ net7.0
+
+
+
+
+
+ """,
additionalFiles:
[
("Directory.Build.props", """
@@ -1824,15 +1824,15 @@ public async Task PropsFileNameWithDifferentCasing()
],
// no change
expectedProjectContents: """
-
-
- net7.0
-
-
-
-
-
- """,
+
+
+ net7.0
+
+
+
+
+
+ """,
additionalFilesExpected:
[
// no change
@@ -1859,25 +1859,25 @@ public async Task VersionAttributeWithDifferentCasing_VersionNumberInline()
// the version attribute in the project has an all lowercase name
await TestUpdateForProject("Newtonsoft.Json", "12.0.1", "13.0.1",
projectContents: """
-
-
- net7.0
-
-
-
-
-
- """,
+
+
+ net7.0
+
+
+
+
+
+ """,
expectedProjectContents: """
-
-
- net7.0
-
-
-
-
-
- """
+
+
+ net7.0
+
+
+
+
+
+ """
);
}
@@ -1887,15 +1887,15 @@ public async Task VersionAttributeWithDifferentCasing_VersionNumberInProperty()
// the version attribute in the project has an all lowercase name
await TestUpdateForProject("Newtonsoft.Json", "12.0.1", "13.0.1",
projectContents: """
-
-
- net7.0
-
-
-
-
-
- """,
+
+
+ net7.0
+
+
+
+
+
+ """,
additionalFiles:
[
("Directory.Build.props", """
@@ -1913,15 +1913,15 @@ public async Task VersionAttributeWithDifferentCasing_VersionNumberInProperty()
],
// no change
expectedProjectContents: """
-
-
- net7.0
-
-
-
-
-
- """,
+
+
+ net7.0
+
+
+
+
+
+ """,
additionalFilesExpected:
[
// no change
@@ -1948,15 +1948,15 @@ public async Task DirectoryPackagesPropsDoesCentralPackagePinningGetsUpdatedIfTr
await TestUpdateForProject("xunit.assert", "2.5.2", "2.5.3",
isTransitive: true,
projectContents: """
-
-
- net7.0
-
-
-
-
-
- """,
+
+
+ net7.0
+
+
+
+
+
+ """,
additionalFiles:
[
("Directory.Packages.props", """
@@ -1973,15 +1973,15 @@ public async Task DirectoryPackagesPropsDoesCentralPackagePinningGetsUpdatedIfTr
""")
],
expectedProjectContents: """
-
-
- net7.0
-
-
-
-
-
- """,
+
+
+ net7.0
+
+
+
+
+
+ """,
additionalFilesExpected:
[
("Directory.Packages.props", """
@@ -2006,15 +2006,15 @@ public async Task DirectoryPackagesPropsDoesNotGetDuplicateEntryIfCentralTransit
await TestUpdateForProject("xunit.assert", "2.5.2", "2.5.3",
isTransitive: true,
projectContents: """
-
-
- net7.0
-
-
-
-
-
- """,
+
+
+ net7.0
+
+
+
+
+
+ """,
additionalFiles:
[
("Directory.Packages.props", """
@@ -2031,15 +2031,15 @@ public async Task DirectoryPackagesPropsDoesNotGetDuplicateEntryIfCentralTransit
""")
],
expectedProjectContents: """
-
-
- net7.0
-
-
-
-
-
- """,
+
+
+ net7.0
+
+
+
+
+
+ """,
additionalFilesExpected:
[
("Directory.Packages.props", """
@@ -2063,25 +2063,25 @@ public async Task PackageWithFourPartVersionCanBeUpdated()
{
await TestUpdateForProject("AWSSDK.Core", "3.7.204.13", "3.7.204.14",
projectContents: """
-
-
- net7.0
-
-
-
-
-
- """,
+
+
+ net7.0
+
+
+
+
+
+ """,
expectedProjectContents: """
-
-
- net7.0
-
-
-
-
-
- """
+
+
+ net7.0
+
+
+
+
+
+ """
);
}
@@ -2090,25 +2090,25 @@ public async Task PackageWithOnlyBuildTargetsCanBeUpdated()
{
await TestUpdateForProject("Microsoft.Windows.Compatibility", "7.0.0", "8.0.0",
projectContents: """
-
-
- net5.0
-
-
-
-
-
- """,
+
+
+ net5.0
+
+
+
+
+
+ """,
expectedProjectContents: """
-
-
- net5.0
-
-
-
-
-
- """
+
+
+ net5.0
+
+
+
+
+
+ """
);
}
@@ -2117,31 +2117,31 @@ public async Task UpdatePackageVersionFromPropertiesWithAndWithoutConditions()
{
await TestUpdateForProject("Newtonsoft.Json", "12.0.1", "13.0.1",
projectContents: """
-
-
- netstandard2.0
- 7.0.1
- 12.0.1
- 9.0.1
-
-
-
-
-
- """,
+
+
+ netstandard2.0
+ 7.0.1
+ 12.0.1
+ 9.0.1
+
+
+
+
+
+ """,
expectedProjectContents: """
-
-
- netstandard2.0
- 7.0.1
- 13.0.1
- 9.0.1
-
-
-
-
-
- """
+
+
+ netstandard2.0
+ 7.0.1
+ 13.0.1
+ 9.0.1
+
+
+
+
+
+ """
);
}
@@ -2150,29 +2150,29 @@ public async Task UpdatePackageVersionFromPropertyWithConditionCheckingForEmptyS
{
await TestUpdateForProject("Newtonsoft.Json", "12.0.1", "13.0.1",
projectContents: """
-
-
- netstandard2.0
- 12.0.1
- 9.0.1
-
-
-
-
-
- """,
+
+
+ netstandard2.0
+ 12.0.1
+ 9.0.1
+
+
+
+
+
+ """,
expectedProjectContents: """
-
-
- netstandard2.0
- 13.0.1
- 9.0.1
-
-
-
-
-
- """
+
+
+ netstandard2.0
+ 13.0.1
+ 9.0.1
+
+
+
+
+
+ """
);
}
}
diff --git a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/JsonHelperTests.cs b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/JsonHelperTests.cs
index 87737f4982b9..38b22b4b9a36 100644
--- a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/JsonHelperTests.cs
+++ b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/JsonHelperTests.cs
@@ -46,12 +46,7 @@ yield return
}
""",
// property path
- new[]
- {
- "tools",
- "microsoft.botsay",
- "version"
- },
+ new[] { "tools", "microsoft.botsay", "version" },
// new value
"1.1.0",
// expected json
@@ -98,11 +93,7 @@ yield return
}
""",
// property path
- new[]
- {
- "msbuild-sdks",
- "Microsoft.Build.NoTargets"
- },
+ new[] { "msbuild-sdks", "Microsoft.Build.NoTargets" },
// new value
"3.7.0",
// expected json
@@ -149,12 +140,7 @@ yield return
}
""",
// property path
- new[]
- {
- "tools",
- "Microsoft.BotSay",
- "version"
- },
+ new[] { "tools", "Microsoft.BotSay", "version" },
// new value
"1.1.0",
// expected json
@@ -195,10 +181,7 @@ yield return
}
""",
// property path
- new[]
- {
- "path2"
- },
+ new[] { "path2" },
// new value
"new-value",
// expected json
diff --git a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs
index e9f8eaed14cf..92a711f61629 100644
--- a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs
+++ b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs
@@ -30,10 +30,7 @@ public void GetRootedValue_FindsValue()
""";
- var propertyInfo = new Dictionary
- {
- { "PackageVersion1", "1.1.1" },
- };
+ var propertyInfo = new Dictionary { { "PackageVersion1", "1.1.1" }, };
// Act
var rootValue = MSBuildHelper.GetRootedValue(projectContents, propertyInfo);
@@ -65,11 +62,7 @@ public async Task GetRootedValue_DoesNotRecurseAsync()
""";
- var propertyInfo = new Dictionary
- {
- { "PackageVersion1", "$(PackageVersion2)" },
- { "PackageVersion2", "$(PackageVersion1)" }
- };
+ var propertyInfo = new Dictionary { { "PackageVersion1", "$(PackageVersion2)" }, { "PackageVersion2", "$(PackageVersion1)" } };
// This is needed to make the timeout work. Without that we could get caugth in an infinite loop.
await Task.Delay(1);
@@ -150,24 +143,17 @@ public async Task AllPackageDependenciesCanBeTraversed()
using var temp = new TemporaryDirectory();
var expectedDependencies = new Dependency[]
{
- new("Microsoft.Bcl.AsyncInterfaces", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.DependencyInjection", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.DependencyInjection.Abstractions", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.Logging", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.Logging.Abstractions", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.Options", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.Primitives", "7.0.0", DependencyType.Unknown),
- new("System.Buffers", "4.5.1", DependencyType.Unknown),
- new("System.ComponentModel.Annotations", "5.0.0", DependencyType.Unknown),
- new("System.Diagnostics.DiagnosticSource", "7.0.0", DependencyType.Unknown),
- new("System.Memory", "4.5.5", DependencyType.Unknown),
- new("System.Numerics.Vectors", "4.4.0", DependencyType.Unknown),
- new("System.Runtime.CompilerServices.Unsafe", "6.0.0", DependencyType.Unknown),
- new("System.Threading.Tasks.Extensions", "4.5.4", DependencyType.Unknown),
- new("NETStandard.Library", "2.0.3", DependencyType.Unknown),
+ new("Microsoft.Bcl.AsyncInterfaces", "7.0.0", DependencyType.Unknown), new("Microsoft.Extensions.DependencyInjection", "7.0.0", DependencyType.Unknown),
+ new("Microsoft.Extensions.DependencyInjection.Abstractions", "7.0.0", DependencyType.Unknown), new("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown),
+ new("Microsoft.Extensions.Logging", "7.0.0", DependencyType.Unknown), new("Microsoft.Extensions.Logging.Abstractions", "7.0.0", DependencyType.Unknown),
+ new("Microsoft.Extensions.Options", "7.0.0", DependencyType.Unknown), new("Microsoft.Extensions.Primitives", "7.0.0", DependencyType.Unknown),
+ new("System.Buffers", "4.5.1", DependencyType.Unknown), new("System.ComponentModel.Annotations", "5.0.0", DependencyType.Unknown),
+ new("System.Diagnostics.DiagnosticSource", "7.0.0", DependencyType.Unknown), new("System.Memory", "4.5.5", DependencyType.Unknown),
+ new("System.Numerics.Vectors", "4.4.0", DependencyType.Unknown), new("System.Runtime.CompilerServices.Unsafe", "6.0.0", DependencyType.Unknown),
+ new("System.Threading.Tasks.Extensions", "4.5.4", DependencyType.Unknown), new("NETStandard.Library", "2.0.3", DependencyType.Unknown),
};
- var actualDependencies = await MSBuildHelper.GetAllPackageDependenciesAsync(temp.DirectoryPath, temp.DirectoryPath, "netstandard2.0", new[] { new Dependency("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown) });
+ var actualDependencies = await MSBuildHelper.GetAllPackageDependenciesAsync(temp.DirectoryPath, temp.DirectoryPath, "netstandard2.0",
+ new[] { new Dependency("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown) });
Assert.Equal(expectedDependencies, actualDependencies);
}
@@ -177,87 +163,52 @@ public async Task AllPackageDependencies_DoNotTruncateLongDependencyLists()
using var temp = new TemporaryDirectory();
var expectedDependencies = new Dependency[]
{
- new("Castle.Core", "4.4.1", DependencyType.Unknown),
- new("Microsoft.ApplicationInsights", "2.10.0", DependencyType.Unknown),
+ new("Castle.Core", "4.4.1", DependencyType.Unknown), new("Microsoft.ApplicationInsights", "2.10.0", DependencyType.Unknown),
new("Microsoft.ApplicationInsights.Agent.Intercept", "2.4.0", DependencyType.Unknown),
new("Microsoft.ApplicationInsights.DependencyCollector", "2.10.0", DependencyType.Unknown),
new("Microsoft.ApplicationInsights.PerfCounterCollector", "2.10.0", DependencyType.Unknown),
new("Microsoft.ApplicationInsights.WindowsServer", "2.10.0", DependencyType.Unknown),
new("Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel", "2.10.0", DependencyType.Unknown),
- new("Microsoft.AspNet.TelemetryCorrelation", "1.0.5", DependencyType.Unknown),
- new("Microsoft.Bcl.AsyncInterfaces", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.Caching.Abstractions", "1.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.Caching.Memory", "1.0.0", DependencyType.Unknown),
+ new("Microsoft.AspNet.TelemetryCorrelation", "1.0.5", DependencyType.Unknown), new("Microsoft.Bcl.AsyncInterfaces", "7.0.0", DependencyType.Unknown),
+ new("Microsoft.Extensions.Caching.Abstractions", "1.0.0", DependencyType.Unknown), new("Microsoft.Extensions.Caching.Memory", "1.0.0", DependencyType.Unknown),
new("Microsoft.Extensions.DependencyInjection", "7.0.0", DependencyType.Unknown),
new("Microsoft.Extensions.DependencyInjection.Abstractions", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.DiagnosticAdapter", "1.1.0", DependencyType.Unknown),
- new("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.Logging", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.Logging.Abstractions", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.Options", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.PlatformAbstractions", "1.1.0", DependencyType.Unknown),
- new("Microsoft.Extensions.Primitives", "7.0.0", DependencyType.Unknown),
- new("Moq", "4.16.1", DependencyType.Unknown),
- new("MSTest.TestFramework", "2.1.0", DependencyType.Unknown),
- new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown),
- new("System", "4.1.311.2", DependencyType.Unknown),
- new("System.Buffers", "4.5.1", DependencyType.Unknown),
- new("System.Collections.Concurrent", "4.3.0", DependencyType.Unknown),
- new("System.Collections.Immutable", "1.3.0", DependencyType.Unknown),
- new("System.Collections.NonGeneric", "4.3.0", DependencyType.Unknown),
- new("System.Collections.Specialized", "4.3.0", DependencyType.Unknown),
- new("System.ComponentModel", "4.3.0", DependencyType.Unknown),
- new("System.ComponentModel.Annotations", "5.0.0", DependencyType.Unknown),
- new("System.ComponentModel.Primitives", "4.3.0", DependencyType.Unknown),
- new("System.ComponentModel.TypeConverter", "4.3.0", DependencyType.Unknown),
- new("System.Core", "3.5.21022.801", DependencyType.Unknown),
- new("System.Data.Common", "4.3.0", DependencyType.Unknown),
- new("System.Diagnostics.DiagnosticSource", "7.0.0", DependencyType.Unknown),
- new("System.Diagnostics.PerformanceCounter", "4.5.0", DependencyType.Unknown),
- new("System.Diagnostics.StackTrace", "4.3.0", DependencyType.Unknown),
- new("System.Dynamic.Runtime", "4.3.0", DependencyType.Unknown),
- new("System.IO.FileSystem.Primitives", "4.3.0", DependencyType.Unknown),
- new("System.Linq", "4.3.0", DependencyType.Unknown),
- new("System.Linq.Expressions", "4.3.0", DependencyType.Unknown),
- new("System.Memory", "4.5.5", DependencyType.Unknown),
- new("System.Net.WebHeaderCollection", "4.3.0", DependencyType.Unknown),
- new("System.Numerics.Vectors", "4.4.0", DependencyType.Unknown),
- new("System.ObjectModel", "4.3.0", DependencyType.Unknown),
- new("System.Private.DataContractSerialization", "4.3.0", DependencyType.Unknown),
- new("System.Reflection.Emit", "4.3.0", DependencyType.Unknown),
- new("System.Reflection.Emit.ILGeneration", "4.3.0", DependencyType.Unknown),
- new("System.Reflection.Emit.Lightweight", "4.3.0", DependencyType.Unknown),
- new("System.Reflection.Metadata", "1.4.1", DependencyType.Unknown),
- new("System.Reflection.TypeExtensions", "4.3.0", DependencyType.Unknown),
- new("System.Runtime.CompilerServices.Unsafe", "6.0.0", DependencyType.Unknown),
- new("System.Runtime.InteropServices.RuntimeInformation", "4.3.0", DependencyType.Unknown),
- new("System.Runtime.Numerics", "4.3.0", DependencyType.Unknown),
- new("System.Runtime.Serialization.Json", "4.3.0", DependencyType.Unknown),
- new("System.Runtime.Serialization.Primitives", "4.3.0", DependencyType.Unknown),
- new("System.Security.Claims", "4.3.0", DependencyType.Unknown),
- new("System.Security.Cryptography.OpenSsl", "4.3.0", DependencyType.Unknown),
- new("System.Security.Cryptography.Primitives", "4.3.0", DependencyType.Unknown),
- new("System.Security.Principal", "4.3.0", DependencyType.Unknown),
- new("System.Text.RegularExpressions", "4.3.0", DependencyType.Unknown),
- new("System.Threading", "4.3.0", DependencyType.Unknown),
- new("System.Threading.Tasks.Extensions", "4.5.4", DependencyType.Unknown),
- new("System.Threading.Thread", "4.3.0", DependencyType.Unknown),
- new("System.Threading.ThreadPool", "4.3.0", DependencyType.Unknown),
- new("System.Xml.ReaderWriter", "4.3.0", DependencyType.Unknown),
- new("System.Xml.XDocument", "4.3.0", DependencyType.Unknown),
- new("System.Xml.XmlDocument", "4.3.0", DependencyType.Unknown),
- new("System.Xml.XmlSerializer", "4.3.0", DependencyType.Unknown),
- new("Microsoft.ApplicationInsights.Web", "2.10.0", DependencyType.Unknown),
- new("MSTest.TestAdapter", "2.1.0", DependencyType.Unknown),
- new("NETStandard.Library", "2.0.3", DependencyType.Unknown),
+ new("Microsoft.Extensions.DiagnosticAdapter", "1.1.0", DependencyType.Unknown), new("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown),
+ new("Microsoft.Extensions.Logging", "7.0.0", DependencyType.Unknown), new("Microsoft.Extensions.Logging.Abstractions", "7.0.0", DependencyType.Unknown),
+ new("Microsoft.Extensions.Options", "7.0.0", DependencyType.Unknown), new("Microsoft.Extensions.PlatformAbstractions", "1.1.0", DependencyType.Unknown),
+ new("Microsoft.Extensions.Primitives", "7.0.0", DependencyType.Unknown), new("Moq", "4.16.1", DependencyType.Unknown),
+ new("MSTest.TestFramework", "2.1.0", DependencyType.Unknown), new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown),
+ new("System", "4.1.311.2", DependencyType.Unknown), new("System.Buffers", "4.5.1", DependencyType.Unknown),
+ new("System.Collections.Concurrent", "4.3.0", DependencyType.Unknown), new("System.Collections.Immutable", "1.3.0", DependencyType.Unknown),
+ new("System.Collections.NonGeneric", "4.3.0", DependencyType.Unknown), new("System.Collections.Specialized", "4.3.0", DependencyType.Unknown),
+ new("System.ComponentModel", "4.3.0", DependencyType.Unknown), new("System.ComponentModel.Annotations", "5.0.0", DependencyType.Unknown),
+ new("System.ComponentModel.Primitives", "4.3.0", DependencyType.Unknown), new("System.ComponentModel.TypeConverter", "4.3.0", DependencyType.Unknown),
+ new("System.Core", "3.5.21022.801", DependencyType.Unknown), new("System.Data.Common", "4.3.0", DependencyType.Unknown),
+ new("System.Diagnostics.DiagnosticSource", "7.0.0", DependencyType.Unknown), new("System.Diagnostics.PerformanceCounter", "4.5.0", DependencyType.Unknown),
+ new("System.Diagnostics.StackTrace", "4.3.0", DependencyType.Unknown), new("System.Dynamic.Runtime", "4.3.0", DependencyType.Unknown),
+ new("System.IO.FileSystem.Primitives", "4.3.0", DependencyType.Unknown), new("System.Linq", "4.3.0", DependencyType.Unknown),
+ new("System.Linq.Expressions", "4.3.0", DependencyType.Unknown), new("System.Memory", "4.5.5", DependencyType.Unknown),
+ new("System.Net.WebHeaderCollection", "4.3.0", DependencyType.Unknown), new("System.Numerics.Vectors", "4.4.0", DependencyType.Unknown),
+ new("System.ObjectModel", "4.3.0", DependencyType.Unknown), new("System.Private.DataContractSerialization", "4.3.0", DependencyType.Unknown),
+ new("System.Reflection.Emit", "4.3.0", DependencyType.Unknown), new("System.Reflection.Emit.ILGeneration", "4.3.0", DependencyType.Unknown),
+ new("System.Reflection.Emit.Lightweight", "4.3.0", DependencyType.Unknown), new("System.Reflection.Metadata", "1.4.1", DependencyType.Unknown),
+ new("System.Reflection.TypeExtensions", "4.3.0", DependencyType.Unknown), new("System.Runtime.CompilerServices.Unsafe", "6.0.0", DependencyType.Unknown),
+ new("System.Runtime.InteropServices.RuntimeInformation", "4.3.0", DependencyType.Unknown), new("System.Runtime.Numerics", "4.3.0", DependencyType.Unknown),
+ new("System.Runtime.Serialization.Json", "4.3.0", DependencyType.Unknown), new("System.Runtime.Serialization.Primitives", "4.3.0", DependencyType.Unknown),
+ new("System.Security.Claims", "4.3.0", DependencyType.Unknown), new("System.Security.Cryptography.OpenSsl", "4.3.0", DependencyType.Unknown),
+ new("System.Security.Cryptography.Primitives", "4.3.0", DependencyType.Unknown), new("System.Security.Principal", "4.3.0", DependencyType.Unknown),
+ new("System.Text.RegularExpressions", "4.3.0", DependencyType.Unknown), new("System.Threading", "4.3.0", DependencyType.Unknown),
+ new("System.Threading.Tasks.Extensions", "4.5.4", DependencyType.Unknown), new("System.Threading.Thread", "4.3.0", DependencyType.Unknown),
+ new("System.Threading.ThreadPool", "4.3.0", DependencyType.Unknown), new("System.Xml.ReaderWriter", "4.3.0", DependencyType.Unknown),
+ new("System.Xml.XDocument", "4.3.0", DependencyType.Unknown), new("System.Xml.XmlDocument", "4.3.0", DependencyType.Unknown),
+ new("System.Xml.XmlSerializer", "4.3.0", DependencyType.Unknown), new("Microsoft.ApplicationInsights.Web", "2.10.0", DependencyType.Unknown),
+ new("MSTest.TestAdapter", "2.1.0", DependencyType.Unknown), new("NETStandard.Library", "2.0.3", DependencyType.Unknown),
};
- var packages = new[] {
- new Dependency("System", "4.1.311.2", DependencyType.Unknown),
- new Dependency("System.Core", "3.5.21022.801", DependencyType.Unknown),
- new Dependency("Moq", "4.16.1", DependencyType.Unknown),
- new Dependency("Castle.Core", "4.4.1", DependencyType.Unknown),
- new Dependency("MSTest.TestAdapter", "2.1.0", DependencyType.Unknown),
- new Dependency("MSTest.TestFramework", "2.1.0", DependencyType.Unknown),
+ var packages = new[]
+ {
+ new Dependency("System", "4.1.311.2", DependencyType.Unknown), new Dependency("System.Core", "3.5.21022.801", DependencyType.Unknown),
+ new Dependency("Moq", "4.16.1", DependencyType.Unknown), new Dependency("Castle.Core", "4.4.1", DependencyType.Unknown),
+ new Dependency("MSTest.TestAdapter", "2.1.0", DependencyType.Unknown), new Dependency("MSTest.TestFramework", "2.1.0", DependencyType.Unknown),
new Dependency("Microsoft.ApplicationInsights", "2.10.0", DependencyType.Unknown),
new Dependency("Microsoft.ApplicationInsights.Agent.Intercept", "2.4.0", DependencyType.Unknown),
new Dependency("Microsoft.ApplicationInsights.DependencyCollector", "2.10.0", DependencyType.Unknown),
@@ -265,8 +216,7 @@ public async Task AllPackageDependencies_DoNotTruncateLongDependencyLists()
new Dependency("Microsoft.ApplicationInsights.Web", "2.10.0", DependencyType.Unknown),
new Dependency("Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel", "2.10.0", DependencyType.Unknown),
new Dependency("Microsoft.ApplicationInsights.WindowsServer", "2.10.0", DependencyType.Unknown),
- new Dependency("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown),
- new Dependency("Newtonsoft.Json", "12.0.1", DependencyType.Unknown)
+ new Dependency("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown), new Dependency("Newtonsoft.Json", "12.0.1", DependencyType.Unknown)
};
var actualDependencies = await MSBuildHelper.GetAllPackageDependenciesAsync(temp.DirectoryPath, temp.DirectoryPath, "netstandard2.0", packages);
for (int i = 0; i < actualDependencies.Length; i++)
@@ -275,6 +225,7 @@ public async Task AllPackageDependencies_DoNotTruncateLongDependencyLists()
var ed = expectedDependencies[i];
Assert.Equal(ed, ad);
}
+
Assert.Equal(expectedDependencies, actualDependencies);
}
@@ -284,26 +235,18 @@ public async Task AllPackageDependencies_DoNotIncludeUpdateOnlyPackages()
using var temp = new TemporaryDirectory();
var expectedDependencies = new Dependency[]
{
- new("Microsoft.Bcl.AsyncInterfaces", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.DependencyInjection", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.DependencyInjection.Abstractions", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.Logging", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.Logging.Abstractions", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.Options", "7.0.0", DependencyType.Unknown),
- new("Microsoft.Extensions.Primitives", "7.0.0", DependencyType.Unknown),
- new("System.Buffers", "4.5.1", DependencyType.Unknown),
- new("System.ComponentModel.Annotations", "5.0.0", DependencyType.Unknown),
- new("System.Diagnostics.DiagnosticSource", "7.0.0", DependencyType.Unknown),
- new("System.Memory", "4.5.5", DependencyType.Unknown),
- new("System.Numerics.Vectors", "4.4.0", DependencyType.Unknown),
- new("System.Runtime.CompilerServices.Unsafe", "6.0.0", DependencyType.Unknown),
- new("System.Threading.Tasks.Extensions", "4.5.4", DependencyType.Unknown),
- new("NETStandard.Library", "2.0.3", DependencyType.Unknown),
+ new("Microsoft.Bcl.AsyncInterfaces", "7.0.0", DependencyType.Unknown), new("Microsoft.Extensions.DependencyInjection", "7.0.0", DependencyType.Unknown),
+ new("Microsoft.Extensions.DependencyInjection.Abstractions", "7.0.0", DependencyType.Unknown), new("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown),
+ new("Microsoft.Extensions.Logging", "7.0.0", DependencyType.Unknown), new("Microsoft.Extensions.Logging.Abstractions", "7.0.0", DependencyType.Unknown),
+ new("Microsoft.Extensions.Options", "7.0.0", DependencyType.Unknown), new("Microsoft.Extensions.Primitives", "7.0.0", DependencyType.Unknown),
+ new("System.Buffers", "4.5.1", DependencyType.Unknown), new("System.ComponentModel.Annotations", "5.0.0", DependencyType.Unknown),
+ new("System.Diagnostics.DiagnosticSource", "7.0.0", DependencyType.Unknown), new("System.Memory", "4.5.5", DependencyType.Unknown),
+ new("System.Numerics.Vectors", "4.4.0", DependencyType.Unknown), new("System.Runtime.CompilerServices.Unsafe", "6.0.0", DependencyType.Unknown),
+ new("System.Threading.Tasks.Extensions", "4.5.4", DependencyType.Unknown), new("NETStandard.Library", "2.0.3", DependencyType.Unknown),
};
- var packages = new[] {
- new Dependency("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown),
- new Dependency("Newtonsoft.Json", "12.0.1", DependencyType.Unknown, IsUpdate: true)
+ var packages = new[]
+ {
+ new Dependency("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown), new Dependency("Newtonsoft.Json", "12.0.1", DependencyType.Unknown, IsUpdate: true)
};
var actualDependencies = await MSBuildHelper.GetAllPackageDependenciesAsync(temp.DirectoryPath, temp.DirectoryPath, "netstandard2.0", packages);
Assert.Equal(expectedDependencies, actualDependencies);
@@ -326,36 +269,33 @@ public async Task AllPackageDependenciesCanBeFoundWithNuGetConfig()
Environment.SetEnvironmentVariable("NUGET_HTTP_CACHE_PATH", tempNuGetHttpCacheDirectory);
// First validate that we are unable to find dependencies for the package version without a NuGet.config.
- var dependenciesNoNuGetConfig = await MSBuildHelper.GetAllPackageDependenciesAsync(temp.DirectoryPath, temp.DirectoryPath, "netstandard2.0", new[] { new Dependency("Microsoft.CodeAnalysis.Common", "4.8.0-3.23457.5", DependencyType.Unknown) });
+ var dependenciesNoNuGetConfig = await MSBuildHelper.GetAllPackageDependenciesAsync(temp.DirectoryPath, temp.DirectoryPath, "netstandard2.0",
+ new[] { new Dependency("Microsoft.CodeAnalysis.Common", "4.8.0-3.23457.5", DependencyType.Unknown) });
Assert.Equal(Array.Empty(), dependenciesNoNuGetConfig);
// Write the NuGet.config and try again.
await File.WriteAllTextAsync(Path.Combine(temp.DirectoryPath, "NuGet.Config"), """
-
-
-
-
-
-
-
-
- """);
+
+
+
+
+
+
+
+
+ """);
var expectedDependencies = new Dependency[]
{
- new("Microsoft.CodeAnalysis.Common", "4.8.0-3.23457.5", DependencyType.Unknown),
- new("System.Buffers", "4.5.1", DependencyType.Unknown),
- new("System.Collections.Immutable", "7.0.0", DependencyType.Unknown),
- new("System.Memory", "4.5.5", DependencyType.Unknown),
- new("System.Numerics.Vectors", "4.4.0", DependencyType.Unknown),
- new("System.Reflection.Metadata", "7.0.0", DependencyType.Unknown),
- new("System.Runtime.CompilerServices.Unsafe", "6.0.0", DependencyType.Unknown),
- new("System.Text.Encoding.CodePages", "7.0.0", DependencyType.Unknown),
- new("System.Threading.Tasks.Extensions", "4.5.4", DependencyType.Unknown),
- new("Microsoft.CodeAnalysis.Analyzers", "3.3.4", DependencyType.Unknown),
+ new("Microsoft.CodeAnalysis.Common", "4.8.0-3.23457.5", DependencyType.Unknown), new("System.Buffers", "4.5.1", DependencyType.Unknown),
+ new("System.Collections.Immutable", "7.0.0", DependencyType.Unknown), new("System.Memory", "4.5.5", DependencyType.Unknown),
+ new("System.Numerics.Vectors", "4.4.0", DependencyType.Unknown), new("System.Reflection.Metadata", "7.0.0", DependencyType.Unknown),
+ new("System.Runtime.CompilerServices.Unsafe", "6.0.0", DependencyType.Unknown), new("System.Text.Encoding.CodePages", "7.0.0", DependencyType.Unknown),
+ new("System.Threading.Tasks.Extensions", "4.5.4", DependencyType.Unknown), new("Microsoft.CodeAnalysis.Analyzers", "3.3.4", DependencyType.Unknown),
new("NETStandard.Library", "2.0.3", DependencyType.Unknown),
};
- var actualDependencies = await MSBuildHelper.GetAllPackageDependenciesAsync(temp.DirectoryPath, temp.DirectoryPath, "netstandard2.0", new[] { new Dependency("Microsoft.CodeAnalysis.Common", "4.8.0-3.23457.5", DependencyType.Unknown) });
+ var actualDependencies = await MSBuildHelper.GetAllPackageDependenciesAsync(temp.DirectoryPath, temp.DirectoryPath, "netstandard2.0",
+ new[] { new Dependency("Microsoft.CodeAnalysis.Common", "4.8.0-3.23457.5", DependencyType.Unknown) });
Assert.Equal(expectedDependencies, actualDependencies);
}
finally
@@ -383,10 +323,7 @@ yield return
""")
},
// expected dependencies
- new Dependency[]
- {
- new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown)
- }
+ new Dependency[] { new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown) }
];
// version is a child-node of the package reference
@@ -406,10 +343,7 @@ yield return
""")
},
// expected dependencies
- new Dependency[]
- {
- new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown)
- }
+ new Dependency[] { new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown) }
];
// version is in property in same file
@@ -430,10 +364,7 @@ yield return
""")
},
// expected dependencies
- new Dependency[]
- {
- new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown)
- }
+ new Dependency[] { new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown) }
];
// version is a property not triggered by a condition
@@ -456,10 +387,7 @@ yield return
""")
},
// expected dependencies
- new Dependency[]
- {
- new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown)
- }
+ new Dependency[] { new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown) }
];
// version is a property not triggered by a quoted condition
@@ -482,10 +410,7 @@ yield return
""")
},
// expected dependencies
- new Dependency[]
- {
- new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown)
- }
+ new Dependency[] { new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown) }
};
// version is a property with a condition checking for an empty string
@@ -508,10 +433,7 @@ yield return
""")
},
// expected dependencies
- new Dependency[]
- {
- new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown)
- }
+ new Dependency[] { new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown) }
];
// version is a property with a quoted condition checking for an empty string
@@ -534,10 +456,7 @@ yield return
""")
},
// expected dependencies
- new Dependency[]
- {
- new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown)
- }
+ new Dependency[] { new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown) }
};
// version is set in one file, used in another
@@ -547,13 +466,13 @@ yield return
new[]
{
("Packages.props", """
-
-
-
-
-
-
- """),
+
+
+
+
+
+
+ """),
("project.csproj", """
@@ -566,11 +485,7 @@ yield return
""")
},
// expected dependencies
- new Dependency[]
- {
- new("Azure.Identity", "1.6.0", DependencyType.Unknown),
- new("Microsoft.Data.SqlClient", "5.1.4", DependencyType.Unknown, IsUpdate: true)
- }
+ new Dependency[] { new("Azure.Identity", "1.6.0", DependencyType.Unknown), new("Microsoft.Data.SqlClient", "5.1.4", DependencyType.Unknown, IsUpdate: true) }
];
// version is set in one file, used in another
@@ -590,20 +505,16 @@ yield return
"""),
("Packages.props", """
-
-
-
-
-
-
- """)
+
+
+
+
+
+
+ """)
},
// expected dependencies
- new Dependency[]
- {
- new("Azure.Identity", "1.6.0", DependencyType.Unknown),
- new("Microsoft.Data.SqlClient", "5.1.4", DependencyType.Unknown, IsUpdate: true)
- }
+ new Dependency[] { new("Azure.Identity", "1.6.0", DependencyType.Unknown), new("Microsoft.Data.SqlClient", "5.1.4", DependencyType.Unknown, IsUpdate: true) }
];
}
@@ -640,11 +551,7 @@ yield return
EndGlobalSection
EndGlobal
""",
- new[]
- {
- "src/Some.Project/SomeProject.csproj",
- "src/Some.Project.Test/Some.Project.Test.csproj",
- }
+ new[] { "src/Some.Project/SomeProject.csproj", "src/Some.Project.Test/Some.Project.Test.csproj", }
];
}
}
diff --git a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/SdkPackageUpdaterHelperTests.cs b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/SdkPackageUpdaterHelperTests.cs
index bef7bd6abca2..a2e957fdd15e 100644
--- a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/SdkPackageUpdaterHelperTests.cs
+++ b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/SdkPackageUpdaterHelperTests.cs
@@ -36,13 +36,7 @@ public async Task DirectoryBuildFilesAreOnlyPulledInFromParentDirectories()
""")
);
var actualBuildFilePaths = await LoadBuildFilesFromTemp(temporaryDirectory, "src/SomeProject.csproj");
- var expectedBuildFilePaths = new[]
- {
- "src/SomeProject.csproj",
- "Directory.Build.props",
- "props/Versions.props",
- "src/Directory.Build.targets",
- };
+ var expectedBuildFilePaths = new[] { "src/SomeProject.csproj", "Directory.Build.props", "props/Versions.props", "src/Directory.Build.targets", };
Assert.Equal(expectedBuildFilePaths, actualBuildFilePaths);
}
@@ -70,11 +64,7 @@ public async Task BuildFileEnumerationWorksEvenWithNonSupportedSdkInGlobalJson(s
""")
);
var actualBuildFilePaths = await LoadBuildFilesFromTemp(temporaryDirectory, $"{projectSubpath}/SomeProject.csproj");
- var expectedBuildFilePaths = new[]
- {
- $"{projectSubpath}SomeProject.csproj",
- $"{projectSubpath}Directory.Build.props",
- };
+ var expectedBuildFilePaths = new[] { $"{projectSubpath}SomeProject.csproj", $"{projectSubpath}Directory.Build.props", };
Assert.Equal(expectedBuildFilePaths, actualBuildFilePaths);
Assert.True(File.Exists($"{temporaryDirectory.DirectoryPath}/{globalJsonSubpath}global.json"), "global.json was not restored");
}
@@ -109,12 +99,7 @@ public async Task BuildFileEnumerationWithNonStandardMSBuildSdkAndNonSupportedSd
""")
);
var actualBuildFilePaths = await LoadBuildFilesFromTemp(temporaryDirectory, "SomeProject.csproj");
- var expectedBuildFilePaths = new[]
- {
- "SomeProject.csproj",
- "NoTargets.props",
- "Versions.props",
- };
+ var expectedBuildFilePaths = new[] { "SomeProject.csproj", "NoTargets.props", "Versions.props", };
Assert.Equal(expectedBuildFilePaths, actualBuildFilePaths);
var globalJsonContent = await File.ReadAllTextAsync($"{temporaryDirectory.DirectoryPath}/global.json");
Assert.Contains("99.99.99", globalJsonContent); // ensure global.json was restored
@@ -135,11 +120,7 @@ public async Task BuildFileEnumerationWithUnsuccessfulImport()
""")
);
var actualBuildFilePaths = await LoadBuildFilesFromTemp(temporaryDirectory, "NonBuildingProject.csproj");
- var expectedBuildFilePaths = new[]
- {
- "NonBuildingProject.csproj",
- "Directory.Build.props",
- };
+ var expectedBuildFilePaths = new[] { "NonBuildingProject.csproj", "Directory.Build.props", };
Assert.Equal(expectedBuildFilePaths, actualBuildFilePaths);
}
@@ -162,10 +143,7 @@ public async Task BuildFileEnumerationWithGlobalJsonWithComments()
""")
);
var actualBuildFilePaths = await LoadBuildFilesFromTemp(temporaryDirectory, "NonBuildingProject.csproj");
- var expectedBuildFilePaths = new[]
- {
- "NonBuildingProject.csproj",
- };
+ var expectedBuildFilePaths = new[] { "NonBuildingProject.csproj", };
Assert.Equal(expectedBuildFilePaths, actualBuildFilePaths);
}
diff --git a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/SdkPackageUpdaterTests.cs b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/SdkPackageUpdaterTests.cs
index c1182e3591e5..c0f2048995b7 100644
--- a/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/SdkPackageUpdaterTests.cs
+++ b/nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/SdkPackageUpdaterTests.cs
@@ -31,7 +31,7 @@ public static IEnumerable