dependabot-nuget 0.251.0 → 0.252.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/helpers/lib/NuGetUpdater/Directory.Common.props +1 -0
  3. data/helpers/lib/NuGetUpdater/Directory.Packages.props +26 -0
  4. data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/DiscoverCommand.cs +35 -0
  5. data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/NuGetUpdater.Cli.csproj +1 -1
  6. data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Program.cs +4 -7
  7. data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Discover.cs +251 -0
  8. data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/NuGetUpdater.Cli.Test.csproj +3 -3
  9. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Dependency.cs +56 -1
  10. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/DependencyType.cs +1 -1
  11. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DirectoryPackagesPropsDiscovery.cs +69 -0
  12. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DirectoryPackagesPropsDiscoveryResult.cs +11 -0
  13. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs +217 -0
  14. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DotNetToolsJsonDiscovery.cs +30 -0
  15. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DotNetToolsJsonDiscoveryResult.cs +10 -0
  16. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/GlobalJsonDiscovery.cs +30 -0
  17. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/GlobalJsonDiscoveryResult.cs +10 -0
  18. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/IDiscoveryResult.cs +14 -0
  19. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/PackagesConfigDiscovery.cs +29 -0
  20. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/PackagesConfigDiscoveryResult.cs +10 -0
  21. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/ProjectDiscoveryResult.cs +13 -0
  22. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/SdkProjectDiscovery.cs +127 -0
  23. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/WorkspaceDiscoveryResult.cs +13 -0
  24. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/EvaluationResult.cs +8 -0
  25. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/EvaluationResultType.cs +9 -0
  26. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Files/BuildFile.cs +6 -8
  27. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Files/DotNetToolsJsonBuildFile.cs +4 -7
  28. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Files/GlobalJsonBuildFile.cs +24 -17
  29. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Files/JsonBuildFile.cs +2 -2
  30. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Files/PackagesConfigBuildFile.cs +8 -13
  31. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Files/ProjectBuildFile.cs +100 -19
  32. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Files/XmlBuildFile.cs +2 -2
  33. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/NuGetUpdater.Core.csproj +6 -6
  34. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Property.cs +6 -0
  35. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/DotNetToolsJsonUpdater.cs +23 -36
  36. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/GlobalJsonUpdater.cs +5 -10
  37. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/SdkPackageUpdater.cs +16 -21
  38. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdaterWorker.cs +4 -19
  39. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/HashSetExtensions.cs +14 -0
  40. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/ImmutableArrayExtensions.cs +18 -0
  41. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/JsonHelper.cs +0 -1
  42. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +121 -68
  43. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/NuGetHelper.cs +27 -4
  44. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTestBase.cs +117 -0
  45. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.DotNetToolsJson.cs +91 -0
  46. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.GlobalJson.cs +71 -0
  47. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.PackagesConfig.cs +59 -0
  48. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Project.cs +380 -0
  49. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.cs +306 -0
  50. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/ExpectedDiscoveryResults.cs +36 -0
  51. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/DotNetToolsJsonBuildFileTests.cs +1 -2
  52. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/GlobalJsonBuildFileTests.cs +2 -3
  53. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/PackagesConfigBuildFileTests.cs +4 -6
  54. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/ProjectBuildFileTests.cs +6 -5
  55. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/NuGetUpdater.Core.Test.csproj +4 -3
  56. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/TemporaryDirectory.cs +38 -6
  57. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs +12 -40
  58. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/AssertEx.cs +272 -0
  59. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/DiffUtil.cs +266 -0
  60. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +195 -152
  61. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/SdkPackageUpdaterHelperTests.cs +7 -11
  62. data/lib/dependabot/nuget/discovery/dependency_details.rb +95 -0
  63. data/lib/dependabot/nuget/discovery/dependency_file_discovery.rb +126 -0
  64. data/lib/dependabot/nuget/discovery/directory_packages_props_discovery.rb +43 -0
  65. data/lib/dependabot/nuget/discovery/discovery_json_reader.rb +83 -0
  66. data/lib/dependabot/nuget/discovery/evaluation_details.rb +63 -0
  67. data/lib/dependabot/nuget/discovery/project_discovery.rb +71 -0
  68. data/lib/dependabot/nuget/discovery/property_details.rb +43 -0
  69. data/lib/dependabot/nuget/discovery/workspace_discovery.rb +66 -0
  70. data/lib/dependabot/nuget/file_parser.rb +19 -128
  71. data/lib/dependabot/nuget/file_updater.rb +28 -60
  72. data/lib/dependabot/nuget/native_helpers.rb +55 -0
  73. data/lib/dependabot/nuget/update_checker/compatibility_checker.rb +3 -8
  74. data/lib/dependabot/nuget/update_checker/dependency_finder.rb +1 -0
  75. data/lib/dependabot/nuget/update_checker/property_updater.rb +1 -0
  76. data/lib/dependabot/nuget/update_checker/tfm_finder.rb +17 -152
  77. data/lib/dependabot/nuget/update_checker/version_finder.rb +1 -6
  78. data/lib/dependabot/nuget/update_checker.rb +4 -1
  79. metadata +43 -11
  80. data/lib/dependabot/nuget/file_parser/dotnet_tools_json_parser.rb +0 -71
  81. data/lib/dependabot/nuget/file_parser/global_json_parser.rb +0 -68
  82. data/lib/dependabot/nuget/file_parser/packages_config_parser.rb +0 -92
  83. data/lib/dependabot/nuget/file_parser/project_file_parser.rb +0 -620
  84. data/lib/dependabot/nuget/file_parser/property_value_finder.rb +0 -225
  85. data/lib/dependabot/nuget/file_updater/property_value_updater.rb +0 -81
@@ -1,14 +1,11 @@
1
- using System;
2
- using System.Collections.Generic;
3
1
  using System.Collections.Immutable;
4
- using System.IO;
5
- using System.Linq;
6
- using System.Threading.Tasks;
7
2
 
8
3
  using Xunit;
9
4
 
10
5
  namespace NuGetUpdater.Core.Test.Utilities;
11
6
 
7
+ using TestFile = (string Path, string Content);
8
+
12
9
  public class MSBuildHelperTests
13
10
  {
14
11
  public MSBuildHelperTests()
@@ -30,15 +27,15 @@ public class MSBuildHelperTests
30
27
  </ItemGroup>
31
28
  </Project>
32
29
  """;
33
- var propertyInfo = new Dictionary<string, string>
30
+ var propertyInfo = new Dictionary<string, Property>
34
31
  {
35
- { "PackageVersion1", "1.1.1" },
32
+ { "PackageVersion1", new("PackageVersion1", "1.1.1", "Packages.props") },
36
33
  };
37
34
 
38
35
  // Act
39
- var (resultType, evaluatedValue, _) = MSBuildHelper.GetEvaluatedValue(projectContents, propertyInfo);
36
+ var (resultType, _, evaluatedValue, _, _) = MSBuildHelper.GetEvaluatedValue(projectContents, propertyInfo);
40
37
 
41
- Assert.Equal(MSBuildHelper.EvaluationResultType.Success, resultType);
38
+ Assert.Equal(EvaluationResultType.Success, resultType);
42
39
 
43
40
  // Assert
44
41
  Assert.Equal("""
@@ -67,19 +64,19 @@ public class MSBuildHelperTests
67
64
  </ItemGroup>
68
65
  </Project>
69
66
  """;
70
- var propertyInfo = new Dictionary<string, string>
67
+ var propertyInfo = new Dictionary<string, Property>
71
68
  {
72
- { "PackageVersion1", "$(PackageVersion2)" },
73
- { "PackageVersion2", "$(PackageVersion1)" }
69
+ { "PackageVersion1", new("PackageVersion1", "$(PackageVersion2)", "Packages.props") },
70
+ { "PackageVersion2", new("PackageVersion2", "$(PackageVersion1)", "Packages.props") }
74
71
  };
75
72
  // This is needed to make the timeout work. Without that we could get caugth in an infinite loop.
76
73
  await Task.Delay(1);
77
74
 
78
75
  // Act
79
- var (resultType, _, errorMessage) = MSBuildHelper.GetEvaluatedValue(projectContents, propertyInfo);
76
+ var (resultType, _, _, _, errorMessage) = MSBuildHelper.GetEvaluatedValue(projectContents, propertyInfo);
80
77
 
81
78
  // Assert
82
- Assert.Equal(MSBuildHelper.EvaluationResultType.CircularReference, resultType);
79
+ Assert.Equal(EvaluationResultType.CircularReference, resultType);
83
80
  Assert.Equal("Property 'PackageVersion1' has a circular reference.", errorMessage);
84
81
  }
85
82
 
@@ -100,7 +97,7 @@ public class MSBuildHelperTests
100
97
  expectedPaths = expectedPaths.Select(p => p.Replace("/", "\\")).ToArray();
101
98
  }
102
99
 
103
- Assert.Equal(expectedPaths, actualProjectSubPaths);
100
+ AssertEx.Equal(expectedPaths, actualProjectSubPaths);
104
101
  }
105
102
  finally
106
103
  {
@@ -122,7 +119,7 @@ public class MSBuildHelperTests
122
119
  var expectedTfms = new[] { expectedTfm1, expectedTfm2 }.Where(tfm => tfm is not null).ToArray();
123
120
  var buildFile = ProjectBuildFile.Open(Path.GetDirectoryName(projectPath)!, projectPath);
124
121
  var actualTfms = MSBuildHelper.GetTargetFrameworkMonikers(ImmutableArray.Create(buildFile));
125
- Assert.Equal(expectedTfms, actualTfms);
122
+ AssertEx.Equal(expectedTfms, actualTfms);
126
123
  }
127
124
  finally
128
125
  {
@@ -132,7 +129,7 @@ public class MSBuildHelperTests
132
129
 
133
130
  [Theory]
134
131
  [MemberData(nameof(GetTopLevelPackageDependencyInfosTestData))]
135
- public async Task TopLevelPackageDependenciesCanBeDetermined((string Path, string Content)[] buildFileContents, Dependency[] expectedTopLevelDependencies)
132
+ public async Task TopLevelPackageDependenciesCanBeDetermined(TestFile[] buildFileContents, Dependency[] expectedTopLevelDependencies)
136
133
  {
137
134
  using var testDirectory = new TemporaryDirectory();
138
135
  var buildFiles = new List<ProjectBuildFile>();
@@ -144,7 +141,7 @@ public class MSBuildHelperTests
144
141
  }
145
142
 
146
143
  var actualTopLevelDependencies = MSBuildHelper.GetTopLevelPackageDependencyInfos(buildFiles.ToImmutableArray());
147
- Assert.Equal(expectedTopLevelDependencies, actualTopLevelDependencies);
144
+ AssertEx.Equal(expectedTopLevelDependencies, actualTopLevelDependencies);
148
145
  }
149
146
 
150
147
  [Fact]
@@ -153,29 +150,29 @@ public class MSBuildHelperTests
153
150
  using var temp = new TemporaryDirectory();
154
151
  var expectedDependencies = new Dependency[]
155
152
  {
156
- new("Microsoft.Bcl.AsyncInterfaces", "7.0.0", DependencyType.Unknown),
157
- new("Microsoft.Extensions.DependencyInjection", "7.0.0", DependencyType.Unknown),
158
- new("Microsoft.Extensions.DependencyInjection.Abstractions", "7.0.0", DependencyType.Unknown),
159
- new("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown),
160
- new("Microsoft.Extensions.Logging", "7.0.0", DependencyType.Unknown),
161
- new("Microsoft.Extensions.Logging.Abstractions", "7.0.0", DependencyType.Unknown),
162
- new("Microsoft.Extensions.Options", "7.0.0", DependencyType.Unknown),
163
- new("Microsoft.Extensions.Primitives", "7.0.0", DependencyType.Unknown),
164
- new("System.Buffers", "4.5.1", DependencyType.Unknown),
165
- new("System.ComponentModel.Annotations", "5.0.0", DependencyType.Unknown),
166
- new("System.Diagnostics.DiagnosticSource", "7.0.0", DependencyType.Unknown),
167
- new("System.Memory", "4.5.5", DependencyType.Unknown),
168
- new("System.Numerics.Vectors", "4.4.0", DependencyType.Unknown),
169
- new("System.Runtime.CompilerServices.Unsafe", "6.0.0", DependencyType.Unknown),
170
- new("System.Threading.Tasks.Extensions", "4.5.4", DependencyType.Unknown),
171
- new("NETStandard.Library", "2.0.3", DependencyType.Unknown),
153
+ new("Microsoft.Bcl.AsyncInterfaces", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
154
+ new("Microsoft.Extensions.DependencyInjection", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
155
+ new("Microsoft.Extensions.DependencyInjection.Abstractions", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
156
+ new("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
157
+ new("Microsoft.Extensions.Logging", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
158
+ new("Microsoft.Extensions.Logging.Abstractions", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
159
+ new("Microsoft.Extensions.Options", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
160
+ new("Microsoft.Extensions.Primitives", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
161
+ new("System.Buffers", "4.5.1", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
162
+ new("System.ComponentModel.Annotations", "5.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
163
+ new("System.Diagnostics.DiagnosticSource", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
164
+ new("System.Memory", "4.5.5", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
165
+ new("System.Numerics.Vectors", "4.4.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
166
+ new("System.Runtime.CompilerServices.Unsafe", "6.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
167
+ new("System.Threading.Tasks.Extensions", "4.5.4", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
168
+ new("NETStandard.Library", "2.0.3", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
172
169
  };
173
170
  var actualDependencies = await MSBuildHelper.GetAllPackageDependenciesAsync(
174
171
  temp.DirectoryPath,
175
172
  temp.DirectoryPath,
176
173
  "netstandard2.0",
177
174
  [new Dependency("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown)]);
178
- Assert.Equal(expectedDependencies, actualDependencies);
175
+ AssertEx.Equal(expectedDependencies, actualDependencies);
179
176
  }
180
177
 
181
178
  [Fact]
@@ -184,79 +181,79 @@ public class MSBuildHelperTests
184
181
  using var temp = new TemporaryDirectory();
185
182
  var expectedDependencies = new Dependency[]
186
183
  {
187
- new("Castle.Core", "4.4.1", DependencyType.Unknown),
188
- new("Microsoft.ApplicationInsights", "2.10.0", DependencyType.Unknown),
189
- new("Microsoft.ApplicationInsights.Agent.Intercept", "2.4.0", DependencyType.Unknown),
190
- new("Microsoft.ApplicationInsights.DependencyCollector", "2.10.0", DependencyType.Unknown),
191
- new("Microsoft.ApplicationInsights.PerfCounterCollector", "2.10.0", DependencyType.Unknown),
192
- new("Microsoft.ApplicationInsights.WindowsServer", "2.10.0", DependencyType.Unknown),
193
- new("Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel", "2.10.0", DependencyType.Unknown),
194
- new("Microsoft.AspNet.TelemetryCorrelation", "1.0.5", DependencyType.Unknown),
195
- new("Microsoft.Bcl.AsyncInterfaces", "7.0.0", DependencyType.Unknown),
196
- new("Microsoft.Extensions.Caching.Abstractions", "1.0.0", DependencyType.Unknown),
197
- new("Microsoft.Extensions.Caching.Memory", "1.0.0", DependencyType.Unknown),
198
- new("Microsoft.Extensions.DependencyInjection", "7.0.0", DependencyType.Unknown),
199
- new("Microsoft.Extensions.DependencyInjection.Abstractions", "7.0.0", DependencyType.Unknown),
200
- new("Microsoft.Extensions.DiagnosticAdapter", "1.1.0", DependencyType.Unknown),
201
- new("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown),
202
- new("Microsoft.Extensions.Logging", "7.0.0", DependencyType.Unknown),
203
- new("Microsoft.Extensions.Logging.Abstractions", "7.0.0", DependencyType.Unknown),
204
- new("Microsoft.Extensions.Options", "7.0.0", DependencyType.Unknown),
205
- new("Microsoft.Extensions.PlatformAbstractions", "1.1.0", DependencyType.Unknown),
206
- new("Microsoft.Extensions.Primitives", "7.0.0", DependencyType.Unknown),
207
- new("Moq", "4.16.1", DependencyType.Unknown),
208
- new("MSTest.TestFramework", "2.1.0", DependencyType.Unknown),
209
- new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown),
210
- new("System", "4.1.311.2", DependencyType.Unknown),
211
- new("System.Buffers", "4.5.1", DependencyType.Unknown),
212
- new("System.Collections.Concurrent", "4.3.0", DependencyType.Unknown),
213
- new("System.Collections.Immutable", "1.3.0", DependencyType.Unknown),
214
- new("System.Collections.NonGeneric", "4.3.0", DependencyType.Unknown),
215
- new("System.Collections.Specialized", "4.3.0", DependencyType.Unknown),
216
- new("System.ComponentModel", "4.3.0", DependencyType.Unknown),
217
- new("System.ComponentModel.Annotations", "5.0.0", DependencyType.Unknown),
218
- new("System.ComponentModel.Primitives", "4.3.0", DependencyType.Unknown),
219
- new("System.ComponentModel.TypeConverter", "4.3.0", DependencyType.Unknown),
220
- new("System.Core", "3.5.21022.801", DependencyType.Unknown),
221
- new("System.Data.Common", "4.3.0", DependencyType.Unknown),
222
- new("System.Diagnostics.DiagnosticSource", "7.0.0", DependencyType.Unknown),
223
- new("System.Diagnostics.PerformanceCounter", "4.5.0", DependencyType.Unknown),
224
- new("System.Diagnostics.StackTrace", "4.3.0", DependencyType.Unknown),
225
- new("System.Dynamic.Runtime", "4.3.0", DependencyType.Unknown),
226
- new("System.IO.FileSystem.Primitives", "4.3.0", DependencyType.Unknown),
227
- new("System.Linq", "4.3.0", DependencyType.Unknown),
228
- new("System.Linq.Expressions", "4.3.0", DependencyType.Unknown),
229
- new("System.Memory", "4.5.5", DependencyType.Unknown),
230
- new("System.Net.WebHeaderCollection", "4.3.0", DependencyType.Unknown),
231
- new("System.Numerics.Vectors", "4.4.0", DependencyType.Unknown),
232
- new("System.ObjectModel", "4.3.0", DependencyType.Unknown),
233
- new("System.Private.DataContractSerialization", "4.3.0", DependencyType.Unknown),
234
- new("System.Reflection.Emit", "4.3.0", DependencyType.Unknown),
235
- new("System.Reflection.Emit.ILGeneration", "4.3.0", DependencyType.Unknown),
236
- new("System.Reflection.Emit.Lightweight", "4.3.0", DependencyType.Unknown),
237
- new("System.Reflection.Metadata", "1.4.1", DependencyType.Unknown),
238
- new("System.Reflection.TypeExtensions", "4.3.0", DependencyType.Unknown),
239
- new("System.Runtime.CompilerServices.Unsafe", "6.0.0", DependencyType.Unknown),
240
- new("System.Runtime.InteropServices.RuntimeInformation", "4.3.0", DependencyType.Unknown),
241
- new("System.Runtime.Numerics", "4.3.0", DependencyType.Unknown),
242
- new("System.Runtime.Serialization.Json", "4.3.0", DependencyType.Unknown),
243
- new("System.Runtime.Serialization.Primitives", "4.3.0", DependencyType.Unknown),
244
- new("System.Security.Claims", "4.3.0", DependencyType.Unknown),
245
- new("System.Security.Cryptography.OpenSsl", "4.3.0", DependencyType.Unknown),
246
- new("System.Security.Cryptography.Primitives", "4.3.0", DependencyType.Unknown),
247
- new("System.Security.Principal", "4.3.0", DependencyType.Unknown),
248
- new("System.Text.RegularExpressions", "4.3.0", DependencyType.Unknown),
249
- new("System.Threading", "4.3.0", DependencyType.Unknown),
250
- new("System.Threading.Tasks.Extensions", "4.5.4", DependencyType.Unknown),
251
- new("System.Threading.Thread", "4.3.0", DependencyType.Unknown),
252
- new("System.Threading.ThreadPool", "4.3.0", DependencyType.Unknown),
253
- new("System.Xml.ReaderWriter", "4.3.0", DependencyType.Unknown),
254
- new("System.Xml.XDocument", "4.3.0", DependencyType.Unknown),
255
- new("System.Xml.XmlDocument", "4.3.0", DependencyType.Unknown),
256
- new("System.Xml.XmlSerializer", "4.3.0", DependencyType.Unknown),
257
- new("Microsoft.ApplicationInsights.Web", "2.10.0", DependencyType.Unknown),
258
- new("MSTest.TestAdapter", "2.1.0", DependencyType.Unknown),
259
- new("NETStandard.Library", "2.0.3", DependencyType.Unknown),
184
+ new("Castle.Core", "4.4.1", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
185
+ new("Microsoft.ApplicationInsights", "2.10.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
186
+ new("Microsoft.ApplicationInsights.Agent.Intercept", "2.4.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
187
+ new("Microsoft.ApplicationInsights.DependencyCollector", "2.10.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
188
+ new("Microsoft.ApplicationInsights.PerfCounterCollector", "2.10.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
189
+ new("Microsoft.ApplicationInsights.WindowsServer", "2.10.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
190
+ new("Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel", "2.10.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
191
+ new("Microsoft.AspNet.TelemetryCorrelation", "1.0.5", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
192
+ new("Microsoft.Bcl.AsyncInterfaces", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
193
+ new("Microsoft.Extensions.Caching.Abstractions", "1.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
194
+ new("Microsoft.Extensions.Caching.Memory", "1.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
195
+ new("Microsoft.Extensions.DependencyInjection", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
196
+ new("Microsoft.Extensions.DependencyInjection.Abstractions", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
197
+ new("Microsoft.Extensions.DiagnosticAdapter", "1.1.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
198
+ new("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
199
+ new("Microsoft.Extensions.Logging", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
200
+ new("Microsoft.Extensions.Logging.Abstractions", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
201
+ new("Microsoft.Extensions.Options", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
202
+ new("Microsoft.Extensions.PlatformAbstractions", "1.1.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
203
+ new("Microsoft.Extensions.Primitives", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
204
+ new("Moq", "4.16.1", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
205
+ new("MSTest.TestFramework", "2.1.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
206
+ new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
207
+ new("System", "4.1.311.2", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
208
+ new("System.Buffers", "4.5.1", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
209
+ new("System.Collections.Concurrent", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
210
+ new("System.Collections.Immutable", "1.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
211
+ new("System.Collections.NonGeneric", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
212
+ new("System.Collections.Specialized", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
213
+ new("System.ComponentModel", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
214
+ new("System.ComponentModel.Annotations", "5.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
215
+ new("System.ComponentModel.Primitives", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
216
+ new("System.ComponentModel.TypeConverter", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
217
+ new("System.Core", "3.5.21022.801", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
218
+ new("System.Data.Common", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
219
+ new("System.Diagnostics.DiagnosticSource", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
220
+ new("System.Diagnostics.PerformanceCounter", "4.5.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
221
+ new("System.Diagnostics.StackTrace", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
222
+ new("System.Dynamic.Runtime", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
223
+ new("System.IO.FileSystem.Primitives", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
224
+ new("System.Linq", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
225
+ new("System.Linq.Expressions", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
226
+ new("System.Memory", "4.5.5", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
227
+ new("System.Net.WebHeaderCollection", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
228
+ new("System.Numerics.Vectors", "4.4.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
229
+ new("System.ObjectModel", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
230
+ new("System.Private.DataContractSerialization", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
231
+ new("System.Reflection.Emit", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
232
+ new("System.Reflection.Emit.ILGeneration", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
233
+ new("System.Reflection.Emit.Lightweight", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
234
+ new("System.Reflection.Metadata", "1.4.1", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
235
+ new("System.Reflection.TypeExtensions", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
236
+ new("System.Runtime.CompilerServices.Unsafe", "6.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
237
+ new("System.Runtime.InteropServices.RuntimeInformation", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
238
+ new("System.Runtime.Numerics", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
239
+ new("System.Runtime.Serialization.Json", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
240
+ new("System.Runtime.Serialization.Primitives", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
241
+ new("System.Security.Claims", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
242
+ new("System.Security.Cryptography.OpenSsl", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
243
+ new("System.Security.Cryptography.Primitives", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
244
+ new("System.Security.Principal", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
245
+ new("System.Text.RegularExpressions", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
246
+ new("System.Threading", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
247
+ new("System.Threading.Tasks.Extensions", "4.5.4", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
248
+ new("System.Threading.Thread", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
249
+ new("System.Threading.ThreadPool", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
250
+ new("System.Xml.ReaderWriter", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
251
+ new("System.Xml.XDocument", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
252
+ new("System.Xml.XmlDocument", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
253
+ new("System.Xml.XmlSerializer", "4.3.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
254
+ new("Microsoft.ApplicationInsights.Web", "2.10.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
255
+ new("MSTest.TestAdapter", "2.1.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
256
+ new("NETStandard.Library", "2.0.3", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
260
257
  };
261
258
  var packages = new[]
262
259
  {
@@ -284,7 +281,7 @@ public class MSBuildHelperTests
284
281
  Assert.Equal(ed, ad);
285
282
  }
286
283
 
287
- Assert.Equal(expectedDependencies, actualDependencies);
284
+ AssertEx.Equal(expectedDependencies, actualDependencies);
288
285
  }
289
286
 
290
287
  [Fact]
@@ -293,22 +290,22 @@ public class MSBuildHelperTests
293
290
  using var temp = new TemporaryDirectory();
294
291
  var expectedDependencies = new Dependency[]
295
292
  {
296
- new("Microsoft.Bcl.AsyncInterfaces", "7.0.0", DependencyType.Unknown),
297
- new("Microsoft.Extensions.DependencyInjection", "7.0.0", DependencyType.Unknown),
298
- new("Microsoft.Extensions.DependencyInjection.Abstractions", "7.0.0", DependencyType.Unknown),
299
- new("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown),
300
- new("Microsoft.Extensions.Logging", "7.0.0", DependencyType.Unknown),
301
- new("Microsoft.Extensions.Logging.Abstractions", "7.0.0", DependencyType.Unknown),
302
- new("Microsoft.Extensions.Options", "7.0.0", DependencyType.Unknown),
303
- new("Microsoft.Extensions.Primitives", "7.0.0", DependencyType.Unknown),
304
- new("System.Buffers", "4.5.1", DependencyType.Unknown),
305
- new("System.ComponentModel.Annotations", "5.0.0", DependencyType.Unknown),
306
- new("System.Diagnostics.DiagnosticSource", "7.0.0", DependencyType.Unknown),
307
- new("System.Memory", "4.5.5", DependencyType.Unknown),
308
- new("System.Numerics.Vectors", "4.4.0", DependencyType.Unknown),
309
- new("System.Runtime.CompilerServices.Unsafe", "6.0.0", DependencyType.Unknown),
310
- new("System.Threading.Tasks.Extensions", "4.5.4", DependencyType.Unknown),
311
- new("NETStandard.Library", "2.0.3", DependencyType.Unknown),
293
+ new("Microsoft.Bcl.AsyncInterfaces", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
294
+ new("Microsoft.Extensions.DependencyInjection", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
295
+ new("Microsoft.Extensions.DependencyInjection.Abstractions", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
296
+ new("Microsoft.Extensions.Http", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
297
+ new("Microsoft.Extensions.Logging", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
298
+ new("Microsoft.Extensions.Logging.Abstractions", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
299
+ new("Microsoft.Extensions.Options", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
300
+ new("Microsoft.Extensions.Primitives", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
301
+ new("System.Buffers", "4.5.1", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
302
+ new("System.ComponentModel.Annotations", "5.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
303
+ new("System.Diagnostics.DiagnosticSource", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
304
+ new("System.Memory", "4.5.5", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
305
+ new("System.Numerics.Vectors", "4.4.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
306
+ new("System.Runtime.CompilerServices.Unsafe", "6.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
307
+ new("System.Threading.Tasks.Extensions", "4.5.4", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
308
+ new("NETStandard.Library", "2.0.3", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
312
309
  };
313
310
  var packages = new[]
314
311
  {
@@ -316,7 +313,7 @@ public class MSBuildHelperTests
316
313
  new Dependency("Newtonsoft.Json", "12.0.1", DependencyType.Unknown, IsUpdate: true)
317
314
  };
318
315
  var actualDependencies = await MSBuildHelper.GetAllPackageDependenciesAsync(temp.DirectoryPath, temp.DirectoryPath, "netstandard2.0", packages);
319
- Assert.Equal(expectedDependencies, actualDependencies);
316
+ AssertEx.Equal(expectedDependencies, actualDependencies);
320
317
  }
321
318
 
322
319
  [Fact]
@@ -409,8 +406,8 @@ public class MSBuildHelperTests
409
406
  """);
410
407
  var expectedDependencies = new Dependency[]
411
408
  {
412
- new("Newtonsoft.Json", "4.5.11", DependencyType.Unknown),
413
- new("NETStandard.Library", "2.0.3", DependencyType.Unknown),
409
+ new("Newtonsoft.Json", "4.5.11", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
410
+ new("NETStandard.Library", "2.0.3", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
414
411
  };
415
412
  var actualDependencies = await MSBuildHelper.GetAllPackageDependenciesAsync(
416
413
  temp.DirectoryPath,
@@ -419,7 +416,7 @@ public class MSBuildHelperTests
419
416
  [new Dependency("Newtonsoft.Json", "4.5.11", DependencyType.Unknown)]
420
417
  );
421
418
  Assert.False(Directory.Exists(tempNuGetHttpCacheDirectory), "The .nuget/.v3-cache directory was created, meaning http was used.");
422
- Assert.Equal(expectedDependencies, actualDependencies);
419
+ AssertEx.Equal(expectedDependencies, actualDependencies);
423
420
  }
424
421
  finally
425
422
  {
@@ -468,17 +465,17 @@ public class MSBuildHelperTests
468
465
 
469
466
  var expectedDependencies = new Dependency[]
470
467
  {
471
- new("Microsoft.CodeAnalysis.Common", "4.8.0-3.23457.5", DependencyType.Unknown),
472
- new("System.Buffers", "4.5.1", DependencyType.Unknown),
473
- new("System.Collections.Immutable", "7.0.0", DependencyType.Unknown),
474
- new("System.Memory", "4.5.5", DependencyType.Unknown),
475
- new("System.Numerics.Vectors", "4.4.0", DependencyType.Unknown),
476
- new("System.Reflection.Metadata", "7.0.0", DependencyType.Unknown),
477
- new("System.Runtime.CompilerServices.Unsafe", "6.0.0", DependencyType.Unknown),
478
- new("System.Text.Encoding.CodePages", "7.0.0", DependencyType.Unknown),
479
- new("System.Threading.Tasks.Extensions", "4.5.4", DependencyType.Unknown),
480
- new("Microsoft.CodeAnalysis.Analyzers", "3.3.4", DependencyType.Unknown),
481
- new("NETStandard.Library", "2.0.3", DependencyType.Unknown),
468
+ new("Microsoft.CodeAnalysis.Common", "4.8.0-3.23457.5", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"]),
469
+ new("System.Buffers", "4.5.1", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
470
+ new("System.Collections.Immutable", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
471
+ new("System.Memory", "4.5.5", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
472
+ new("System.Numerics.Vectors", "4.4.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
473
+ new("System.Reflection.Metadata", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
474
+ new("System.Runtime.CompilerServices.Unsafe", "6.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
475
+ new("System.Text.Encoding.CodePages", "7.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
476
+ new("System.Threading.Tasks.Extensions", "4.5.4", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
477
+ new("Microsoft.CodeAnalysis.Analyzers", "3.3.4", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
478
+ new("NETStandard.Library", "2.0.3", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
482
479
  };
483
480
  var actualDependencies = await MSBuildHelper.GetAllPackageDependenciesAsync(
484
481
  temp.DirectoryPath,
@@ -486,7 +483,7 @@ public class MSBuildHelperTests
486
483
  "netstandard2.0",
487
484
  [new Dependency("Microsoft.CodeAnalysis.Common", "4.8.0-3.23457.5", DependencyType.Unknown)]
488
485
  );
489
- Assert.Equal(expectedDependencies, actualDependencies);
486
+ AssertEx.Equal(expectedDependencies, actualDependencies);
490
487
  }
491
488
  finally
492
489
  {
@@ -515,7 +512,11 @@ public class MSBuildHelperTests
515
512
  // expected dependencies
516
513
  new Dependency[]
517
514
  {
518
- new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown)
515
+ new(
516
+ "Newtonsoft.Json",
517
+ "12.0.1",
518
+ DependencyType.PackageReference,
519
+ EvaluationResult: new(EvaluationResultType.Success, "12.0.1", "12.0.1", null, null))
519
520
  }
520
521
  ];
521
522
 
@@ -538,7 +539,11 @@ public class MSBuildHelperTests
538
539
  // expected dependencies
539
540
  new Dependency[]
540
541
  {
541
- new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown)
542
+ new(
543
+ "Newtonsoft.Json",
544
+ "12.0.1",
545
+ DependencyType.PackageReference,
546
+ EvaluationResult: new(EvaluationResultType.Success, "12.0.1", "12.0.1", null, null))
542
547
  }
543
548
  ];
544
549
 
@@ -562,7 +567,11 @@ public class MSBuildHelperTests
562
567
  // expected dependencies
563
568
  new Dependency[]
564
569
  {
565
- new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown)
570
+ new(
571
+ "Newtonsoft.Json",
572
+ "12.0.1",
573
+ DependencyType.PackageReference,
574
+ new(EvaluationResultType.Success, "$(NewtonsoftJsonVersion)", "12.0.1", "NewtonsoftJsonVersion", null))
566
575
  }
567
576
  ];
568
577
 
@@ -588,7 +597,11 @@ public class MSBuildHelperTests
588
597
  // expected dependencies
589
598
  new Dependency[]
590
599
  {
591
- new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown)
600
+ new(
601
+ "Newtonsoft.Json",
602
+ "12.0.1",
603
+ DependencyType.PackageReference,
604
+ new(EvaluationResultType.Success, "$(NewtonsoftJsonVersion)", "12.0.1", "NewtonsoftJsonVersion", null))
592
605
  }
593
606
  ];
594
607
 
@@ -614,7 +627,11 @@ public class MSBuildHelperTests
614
627
  // expected dependencies
615
628
  new Dependency[]
616
629
  {
617
- new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown)
630
+ new(
631
+ "Newtonsoft.Json",
632
+ "12.0.1",
633
+ DependencyType.PackageReference,
634
+ new(EvaluationResultType.Success, "$(NewtonsoftJsonVersion)", "12.0.1", "NewtonsoftJsonVersion", null))
618
635
  }
619
636
  };
620
637
 
@@ -640,7 +657,11 @@ public class MSBuildHelperTests
640
657
  // expected dependencies
641
658
  new Dependency[]
642
659
  {
643
- new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown)
660
+ new(
661
+ "Newtonsoft.Json",
662
+ "12.0.1",
663
+ DependencyType.PackageReference,
664
+ new(EvaluationResultType.Success, "$(NewtonsoftJsonVersion)", "12.0.1", "NewtonsoftJsonVersion", null))
644
665
  }
645
666
  ];
646
667
 
@@ -666,7 +687,11 @@ public class MSBuildHelperTests
666
687
  // expected dependencies
667
688
  new Dependency[]
668
689
  {
669
- new("Newtonsoft.Json", "12.0.1", DependencyType.Unknown)
690
+ new(
691
+ "Newtonsoft.Json",
692
+ "12.0.1",
693
+ DependencyType.PackageReference,
694
+ new(EvaluationResultType.Success, "$(NewtonsoftJsonVersion)", "12.0.1", "NewtonsoftJsonVersion", null))
670
695
  }
671
696
  };
672
697
 
@@ -698,8 +723,17 @@ public class MSBuildHelperTests
698
723
  // expected dependencies
699
724
  new Dependency[]
700
725
  {
701
- new("Azure.Identity", "1.6.0", DependencyType.Unknown),
702
- new("Microsoft.Data.SqlClient", "5.1.4", DependencyType.Unknown, IsUpdate: true)
726
+ new(
727
+ "Azure.Identity",
728
+ "1.6.0",
729
+ DependencyType.PackageReference,
730
+ EvaluationResult: new(EvaluationResultType.Success, "1.6.0", "1.6.0", null, null)),
731
+ new(
732
+ "Microsoft.Data.SqlClient",
733
+ "5.1.4",
734
+ DependencyType.PackageReference,
735
+ EvaluationResult: new(EvaluationResultType.Success, "5.1.4", "5.1.4", null, null),
736
+ IsUpdate: true),
703
737
  }
704
738
  ];
705
739
 
@@ -731,8 +765,17 @@ public class MSBuildHelperTests
731
765
  // expected dependencies
732
766
  new Dependency[]
733
767
  {
734
- new("Azure.Identity", "1.6.0", DependencyType.Unknown),
735
- new("Microsoft.Data.SqlClient", "5.1.4", DependencyType.Unknown, IsUpdate: true)
768
+ new(
769
+ "Azure.Identity",
770
+ "1.6.0",
771
+ DependencyType.PackageReference,
772
+ EvaluationResult: new(EvaluationResultType.Success, "1.6.0", "1.6.0", null, null)),
773
+ new(
774
+ "Microsoft.Data.SqlClient",
775
+ "5.1.4",
776
+ DependencyType.PackageReference,
777
+ EvaluationResult: new(EvaluationResultType.Success, "5.1.4", "5.1.4", null, null),
778
+ IsUpdate: true),
736
779
  }
737
780
  ];
738
781
  }
@@ -1,7 +1,3 @@
1
- using System.IO;
2
- using System.Linq;
3
- using System.Threading.Tasks;
4
-
5
1
  using Xunit;
6
2
 
7
3
  namespace NuGetUpdater.Core.Test.Utilities
@@ -11,7 +7,7 @@ namespace NuGetUpdater.Core.Test.Utilities
11
7
  [Fact]
12
8
  public async Task DirectoryBuildFilesAreOnlyPulledInFromParentDirectories()
13
9
  {
14
- using var temporaryDirectory = TemporaryDirectory.CreateWithContents(
10
+ using var temporaryDirectory = await TemporaryDirectory.CreateWithContentsAsync(
15
11
  ("src/SomeProject.csproj", """
16
12
  <Project Sdk="Microsoft.NET.Sdk">
17
13
  <Import Project="..\props\Versions.props" />
@@ -52,7 +48,7 @@ namespace NuGetUpdater.Core.Test.Utilities
52
48
  [InlineData("src/", "")] // project in subdirectory, global.json at root
53
49
  public async Task BuildFileEnumerationWorksEvenWithNonSupportedSdkInGlobalJson(string projectSubpath, string globalJsonSubpath)
54
50
  {
55
- using var temporaryDirectory = TemporaryDirectory.CreateWithContents(
51
+ using var temporaryDirectory = await TemporaryDirectory.CreateWithContentsAsync(
56
52
  ($"{projectSubpath}SomeProject.csproj", """
57
53
  <Project Sdk="Microsoft.NET.Sdk">
58
54
  </Project>
@@ -82,7 +78,7 @@ namespace NuGetUpdater.Core.Test.Utilities
82
78
  [Fact]
83
79
  public async Task BuildFileEnumerationWithNonStandardMSBuildSdkAndNonSupportedSdkVersionInGlobalJson()
84
80
  {
85
- using var temporaryDirectory = TemporaryDirectory.CreateWithContents(
81
+ using var temporaryDirectory = await TemporaryDirectory.CreateWithContentsAsync(
86
82
  ("global.json", """
87
83
  {
88
84
  "sdk": {
@@ -123,7 +119,7 @@ namespace NuGetUpdater.Core.Test.Utilities
123
119
  [Fact]
124
120
  public async Task BuildFileEnumerationWithUnsuccessfulImport()
125
121
  {
126
- using var temporaryDirectory = TemporaryDirectory.CreateWithContents(
122
+ using var temporaryDirectory = await TemporaryDirectory.CreateWithContentsAsync(
127
123
  ("Directory.Build.props", """
128
124
  <Project>
129
125
  <Import Project="file-that-does-not-exist.targets" />
@@ -146,7 +142,7 @@ namespace NuGetUpdater.Core.Test.Utilities
146
142
  [Fact]
147
143
  public async Task BuildFileEnumerationWithGlobalJsonWithComments()
148
144
  {
149
- using var temporaryDirectory = TemporaryDirectory.CreateWithContents(
145
+ using var temporaryDirectory = await TemporaryDirectory.CreateWithContentsAsync(
150
146
  ("global.json", """
151
147
  {
152
148
  // this is a comment
@@ -171,8 +167,8 @@ namespace NuGetUpdater.Core.Test.Utilities
171
167
 
172
168
  private static async Task<string[]> LoadBuildFilesFromTemp(TemporaryDirectory temporaryDirectory, string relativeProjectPath)
173
169
  {
174
- var buildFiles = await MSBuildHelper.LoadBuildFiles(temporaryDirectory.DirectoryPath, $"{temporaryDirectory.DirectoryPath}/{relativeProjectPath}");
175
- var buildFilePaths = buildFiles.Select(f => f.RepoRelativePath.NormalizePathToUnix()).ToArray();
170
+ var buildFiles = await MSBuildHelper.LoadBuildFilesAsync(temporaryDirectory.DirectoryPath, $"{temporaryDirectory.DirectoryPath}/{relativeProjectPath}");
171
+ var buildFilePaths = buildFiles.Select(f => f.RelativePath.NormalizePathToUnix()).ToArray();
176
172
  return buildFilePaths;
177
173
  }
178
174
  }