save progress
This commit is contained in:
@@ -222,7 +222,7 @@ public class ProofLedgerTests
|
||||
var originalRootHash = ledger.RootHash();
|
||||
|
||||
// Act
|
||||
var json = ledger.ToJson();
|
||||
var json = ledger.ToJson(DateTimeOffset.UtcNow);
|
||||
var restored = ProofLedger.FromJson(json);
|
||||
|
||||
// Assert
|
||||
@@ -236,7 +236,7 @@ public class ProofLedgerTests
|
||||
// Arrange
|
||||
var nodes = CreateTestNodes();
|
||||
var ledger = ProofLedger.FromNodes(nodes);
|
||||
var json = ledger.ToJson();
|
||||
var json = ledger.ToJson(DateTimeOffset.UtcNow);
|
||||
|
||||
// Tamper with the JSON (9.0 serializes as 9 without decimal point)
|
||||
var tampered = json.Replace("\"total\":9,", "\"total\":8,");
|
||||
|
||||
@@ -274,7 +274,7 @@ public class VexNormalizerTests
|
||||
var normalizer = new CsafVexNormalizer();
|
||||
var subject = CreateTestSubject();
|
||||
|
||||
var claim = normalizer.NormalizeStatement(subject, CsafProductStatus.KnownAffected);
|
||||
var claim = normalizer.NormalizeStatement(subject, CsafProductStatus.KnownAffected, DateTimeOffset.UtcNow);
|
||||
|
||||
Assert.Contains(claim.Assertions, a =>
|
||||
a.Atom == SecurityAtom.Present && a.Value == true);
|
||||
@@ -288,7 +288,7 @@ public class VexNormalizerTests
|
||||
var normalizer = new CsafVexNormalizer();
|
||||
var subject = CreateTestSubject();
|
||||
|
||||
var claim = normalizer.NormalizeStatement(subject, CsafProductStatus.KnownNotAffected);
|
||||
var claim = normalizer.NormalizeStatement(subject, CsafProductStatus.KnownNotAffected, DateTimeOffset.UtcNow);
|
||||
|
||||
Assert.Contains(claim.Assertions, a =>
|
||||
a.Atom == SecurityAtom.Applies && a.Value == false);
|
||||
@@ -300,7 +300,7 @@ public class VexNormalizerTests
|
||||
var normalizer = new CsafVexNormalizer();
|
||||
var subject = CreateTestSubject();
|
||||
|
||||
var claim = normalizer.NormalizeStatement(subject, CsafProductStatus.Fixed);
|
||||
var claim = normalizer.NormalizeStatement(subject, CsafProductStatus.Fixed, DateTimeOffset.UtcNow);
|
||||
|
||||
Assert.Contains(claim.Assertions, a =>
|
||||
a.Atom == SecurityAtom.Fixed && a.Value == true);
|
||||
@@ -312,7 +312,7 @@ public class VexNormalizerTests
|
||||
var normalizer = new CsafVexNormalizer();
|
||||
var subject = CreateTestSubject();
|
||||
|
||||
var claim = normalizer.NormalizeStatement(subject, CsafProductStatus.UnderInvestigation);
|
||||
var claim = normalizer.NormalizeStatement(subject, CsafProductStatus.UnderInvestigation, DateTimeOffset.UtcNow);
|
||||
|
||||
Assert.Empty(claim.Assertions);
|
||||
}
|
||||
@@ -326,6 +326,7 @@ public class VexNormalizerTests
|
||||
var claim = normalizer.NormalizeStatement(
|
||||
subject,
|
||||
CsafProductStatus.KnownNotAffected,
|
||||
DateTimeOffset.UtcNow,
|
||||
CsafFlagLabel.VulnerableCodeNotInExecutePath);
|
||||
|
||||
Assert.Contains(claim.Assertions, a =>
|
||||
@@ -341,6 +342,7 @@ public class VexNormalizerTests
|
||||
var claim = normalizer.NormalizeStatement(
|
||||
subject,
|
||||
CsafProductStatus.KnownNotAffected,
|
||||
DateTimeOffset.UtcNow,
|
||||
CsafFlagLabel.ComponentNotPresent);
|
||||
|
||||
Assert.Contains(claim.Assertions, a =>
|
||||
|
||||
Reference in New Issue
Block a user