docs(tests): fix CommentChecker findings across tests/ — 13,392 → 0 (repo-wide scan clean)
Comment/XML-doc changes only: - add summaries to ~10k test methods, fixtures, fakes and helpers (+ <param> on theories, <returns> on async Task methods, <inheritdoc/> on interface implementations the checker can resolve) - strip ~2.6k project-tracking references (WP*, P*-*, row-NN, Task N, #NN, Component-0NN) from comments, keeping the explanatory text; reword false positives in comments only - real docs on fakes implementing BCL/library interfaces (IDisposable, ILogger, IOptionsMonitor, IAsyncLifetime) - reword the last 5 src/ false positives (CWE-1236, failures-1, year-0001, M365) Only non-comment edits: four one-line nested classes split across lines so members can carry docs. Build 0 errors / 0 warnings.
This commit is contained in:
@@ -10,11 +10,12 @@ public sealed class ManifestBuilderTests
|
||||
private static BundleSummary EmptySummary => new(0, 0, 0, 0, 0, 0, 0, 0);
|
||||
private static IReadOnlyList<ManifestContentEntry> NoContents => Array.Empty<ManifestContentEntry>();
|
||||
|
||||
/// <summary>Verifies that building a manifest populates the summary from the contents.</summary>
|
||||
[Fact]
|
||||
public void Build_populates_summary_from_contents()
|
||||
{
|
||||
var sut = new ManifestBuilder();
|
||||
// M8 (B3): summary now carries trailing Sites/DataConnections/Instances counts.
|
||||
// Summary now carries trailing Sites/DataConnections/Instances counts.
|
||||
var summary = new BundleSummary(2, 1, 0, 0, 0, 0, 0, 0, Sites: 3, DataConnections: 4, Instances: 5);
|
||||
var contents = new[]
|
||||
{
|
||||
@@ -26,7 +27,7 @@ public sealed class ManifestBuilderTests
|
||||
var manifest = sut.Build("env", "user", "1.0.0", encryption: null, summary, contents, contentBytes: new byte[] { 1, 2, 3 });
|
||||
|
||||
Assert.Equal(summary, manifest.Summary);
|
||||
// New M8 summary counts flow through the builder verbatim.
|
||||
// New summary counts flow through the builder verbatim.
|
||||
Assert.Equal(3, manifest.Summary.Sites);
|
||||
Assert.Equal(4, manifest.Summary.DataConnections);
|
||||
Assert.Equal(5, manifest.Summary.Instances);
|
||||
@@ -35,11 +36,12 @@ public sealed class ManifestBuilderTests
|
||||
Assert.Equal("user", manifest.ExportedBy);
|
||||
Assert.Equal("1.0.0", manifest.ScadaBridgeVersion);
|
||||
Assert.Equal(1, manifest.BundleFormatVersion);
|
||||
// M8 (B3): schema minor bumped 1.0 → 1.1; format version stays 1.
|
||||
// Schema minor bumped 1.0 → 1.1; format version stays 1.
|
||||
Assert.Equal("1.1", manifest.SchemaVersion);
|
||||
Assert.Null(manifest.Encryption);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that building a manifest computes a content hash with the sha256 prefix.</summary>
|
||||
[Fact]
|
||||
public void Build_computes_content_hash_with_sha256_prefix()
|
||||
{
|
||||
@@ -52,6 +54,7 @@ public sealed class ManifestBuilderTests
|
||||
Assert.Equal("sha256:" + expectedHashHex, manifest.ContentHash);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that validation rejects an unsupported bundle format version.</summary>
|
||||
[Fact]
|
||||
public void Validate_rejects_unsupported_bundleFormatVersion()
|
||||
{
|
||||
@@ -74,6 +77,7 @@ public sealed class ManifestBuilderTests
|
||||
Assert.Equal(ManifestValidationResult.UnsupportedFormatVersion, result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that validation rejects a manifest whose content hash does not match.</summary>
|
||||
[Fact]
|
||||
public void Validate_rejects_when_contentHash_mismatch()
|
||||
{
|
||||
@@ -95,6 +99,7 @@ public sealed class ManifestBuilderTests
|
||||
Assert.Equal(ManifestValidationResult.ContentHashMismatch, result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that validation accepts a well-formed version 1 manifest.</summary>
|
||||
[Fact]
|
||||
public void Validate_accepts_well_formed_v1_manifest()
|
||||
{
|
||||
@@ -107,10 +112,11 @@ public sealed class ManifestBuilderTests
|
||||
Assert.Equal(ManifestValidationResult.Ok, result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that validation accepts an older schema version 1.0 manifest.</summary>
|
||||
[Fact]
|
||||
public void Validate_accepts_older_schemaVersion_1_0_manifest()
|
||||
{
|
||||
// An older "1.0" bundle (pre-M8) must still import: schema minor differences
|
||||
// An older "1.0" bundle must still import: schema minor differences
|
||||
// are additive and the validator gates only on BundleFormatVersion.
|
||||
var bytes = Encoding.UTF8.GetBytes("legacy-bundle");
|
||||
var hash = "sha256:" + Convert.ToHexString(SHA256.HashData(bytes)).ToLowerInvariant();
|
||||
@@ -131,6 +137,7 @@ public sealed class ManifestBuilderTests
|
||||
Assert.Equal(ManifestValidationResult.Ok, result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that validation refuses bundle format version 2.</summary>
|
||||
[Fact]
|
||||
public void Validate_refuses_bundleFormatVersion_2()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user