Skip to content

Commit 4bc88cc

Browse files
committed
Deserialize old scan results for now due to type discriminator
1 parent 6782507 commit 4bc88cc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/Microsoft.ComponentDetection.VerificationTests/ComponentDetectionIntegrationTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ namespace Microsoft.ComponentDetection.VerificationTests;
55
using System.Collections.Generic;
66
using System.IO;
77
using System.Linq;
8-
using System.Text.Json;
98
using System.Text.RegularExpressions;
109
using AwesomeAssertions;
1110
using AwesomeAssertions.Execution;
1211
using Microsoft.ComponentDetection.Contracts.BcdeModels;
1312
using Microsoft.VisualStudio.TestTools.UnitTesting;
13+
using Newtonsoft.Json;
1414

1515
[TestClass]
1616
public class ComponentDetectionIntegrationTests
@@ -151,7 +151,7 @@ private void CompareGraphs(DependencyGraphCollection leftGraphs, DependencyGraph
151151
rightDependencies.Should().Contain(leftDependency, $"Component dependency {leftDependency} for component {leftComponent} was not in the {rightGraphName} dependency graph.");
152152
}
153153

154-
leftDependencies.Should().BeEquivalentTo(rightDependencies, $"{rightGraphName} has the following components that were not found in {leftGraphName}, please verify this is expected behavior. {JsonSerializer.Serialize(rightDependencies.Except(leftDependencies))}");
154+
leftDependencies.Should().BeEquivalentTo(rightDependencies, $"{rightGraphName} has the following components that were not found in {leftGraphName}, please verify this is expected behavior. {System.Text.Json.JsonSerializer.Serialize(rightDependencies.Except(leftDependencies))}");
155155
}
156156
}
157157
}
@@ -283,11 +283,11 @@ private void SetupGithub(string oldGithubArtifactsDir, string newGithubArtifacts
283283
{
284284
var oldGithubDirectory = new DirectoryInfo(oldGithubArtifactsDir);
285285
this.oldLogFileContents = this.GetFileTextWithPattern("GovCompDisc_Log*.log", oldGithubDirectory);
286-
this.oldScanResult = JsonSerializer.Deserialize<DefaultGraphScanResult>(this.GetFileTextWithPattern("ScanManifest*.json", oldGithubDirectory));
286+
this.oldScanResult = JsonConvert.DeserializeObject<DefaultGraphScanResult>(this.GetFileTextWithPattern("ScanManifest*.json", oldGithubDirectory));
287287

288288
var newGithubDirectory = new DirectoryInfo(newGithubArtifactsDir);
289289
this.newLogFileContents = this.GetFileTextWithPattern("GovCompDisc_Log*.log", newGithubDirectory);
290-
this.newScanResult = JsonSerializer.Deserialize<DefaultGraphScanResult>(this.GetFileTextWithPattern("ScanManifest*.json", newGithubDirectory));
290+
this.newScanResult = System.Text.Json.JsonSerializer.Deserialize<DefaultGraphScanResult>(this.GetFileTextWithPattern("ScanManifest*.json", newGithubDirectory));
291291
}
292292

293293
private string GetFileTextWithPattern(string pattern, DirectoryInfo directory)

0 commit comments

Comments
 (0)