fix(test): duplicate spdx external refs (#785)

This commit is contained in:
Justin Perez 2023-09-14 15:47:20 -07:00 коммит произвёл GitHub
Родитель ce8af5ead6
Коммит 69ded7c522
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -257,7 +257,7 @@ public class ComponentDetectionIntegrationTests
[TestMethod]
public void VerifyLocationsFoundAt()
{
static string GetKey(ScannedComponent component) => component.DetectorId + component.Component.Id;
static string GetKey(ScannedComponent component) => $"{component.DetectorId}|{component.Component.Id}|{component.Component.PackageUrl}";
// The other tests check that both graphs have the same components, so we will assume that the components are the same.
var inScopeComponents = this.oldScanResult.ComponentsFound
@ -267,13 +267,15 @@ public class ComponentDetectionIntegrationTests
var oldLocations = this.oldScanResult.ComponentsFound
.Where(x => inScopeComponents.Contains(GetKey(x)))
.DistinctBy(GetKey)
.ToDictionary(GetKey, x => x.LocationsFoundAt.ToHashSet());
var newLocations = this.newScanResult.ComponentsFound
.Where(x => inScopeComponents.Contains(GetKey(x)))
.DistinctBy(GetKey)
.ToDictionary(GetKey, x => x.LocationsFoundAt.ToHashSet());
oldLocations.Should().BeEquivalentTo(newLocations, "The locations found for each component should be the same.");
oldLocations.Should().BeEquivalentTo(newLocations, options => options.AllowingInfiniteRecursion(), "The locations found for each component should be the same.");
}
private void SetupGithub(string oldGithubArtifactsDir, string newGithubArtifactsDir)

Просмотреть файл

@ -22,6 +22,7 @@
<PackageReference Include="MSTest.TestAdapter" />
<PackageReference Include="MSTest.TestFramework" />
<PackageReference Include="Newtonsoft.Json.Schema" />
<PackageReference Include="packageurl-dotnet" />
<PackageReference Include="System.Threading.Tasks.Dataflow" />
</ItemGroup>