Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: update spdx from AdvSec #794

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ private void ProcessDetectorVersions()
[TestMethod]
public void VerifyLocationsFoundAt()
{
static string GetKey(ScannedComponent component) => $"{component.DetectorId}|{component.Component.Id}|{component.Component.PackageUrl}";
static string GetKey(ScannedComponent component) => component.DetectorId + component.Component.Id;

// 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
Expand All @@ -267,15 +267,13 @@ public void VerifyLocationsFoundAt()

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, options => options.AllowingInfiniteRecursion(), "The locations found for each component should be the same.");
oldLocations.Should().BeEquivalentTo(newLocations, "The locations found for each component should be the same.");
}

private void SetupGithub(string oldGithubArtifactsDir, string newGithubArtifactsDir)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<PackageReference Include="MSTest.TestAdapter" />
<PackageReference Include="MSTest.TestFramework" />
<PackageReference Include="Newtonsoft.Json.Schema" />
<PackageReference Include="packageurl-dotnet" />
<PackageReference Include="System.Threading.Tasks.Dataflow" />
</ItemGroup>

Expand Down
Loading