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:
+24
-6
@@ -23,7 +23,7 @@ using TransportExportPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Des
|
||||
namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Pages.Design;
|
||||
|
||||
/// <summary>
|
||||
/// bUnit + logic tests for the TransportExport wizard (Component #24, Task T21).
|
||||
/// bUnit + logic tests for the TransportExport wizard (Transport component).
|
||||
///
|
||||
/// <para>
|
||||
/// Covers the four contract points the design plan calls out:
|
||||
@@ -54,6 +54,7 @@ public class TransportExportPageTests : BunitContext
|
||||
private readonly ISiteRepository _siteRepo = Substitute.For<ISiteRepository>();
|
||||
private readonly IBundleExporter _exporter = Substitute.For<IBundleExporter>();
|
||||
|
||||
/// <summary>Initializes a new instance of <c>TransportExportPageTests</c>.</summary>
|
||||
public TransportExportPageTests()
|
||||
{
|
||||
JSInterop.Mode = JSRuntimeMode.Loose;
|
||||
@@ -76,7 +77,7 @@ public class TransportExportPageTests : BunitContext
|
||||
.Returns(Task.FromResult<IReadOnlyList<SmtpConfiguration>>(new List<SmtpConfiguration>()));
|
||||
_inboundApiRepo.GetAllApiMethodsAsync(Arg.Any<CancellationToken>())
|
||||
.Returns(Task.FromResult<IReadOnlyList<ApiMethod>>(new List<ApiMethod>()));
|
||||
// Empty site/instance defaults — the M8 site/instance picker calls these on load
|
||||
// Empty site/instance defaults — the site/instance picker calls these on load
|
||||
// and the DependencyResolver fans out over sites on resolve.
|
||||
_siteRepo.GetAllSitesAsync(Arg.Any<CancellationToken>())
|
||||
.Returns(Task.FromResult<IReadOnlyList<Site>>(new List<Site>()));
|
||||
@@ -92,7 +93,7 @@ public class TransportExportPageTests : BunitContext
|
||||
Services.AddSingleton(_siteRepo);
|
||||
Services.AddSingleton(_exporter);
|
||||
// DependencyResolver is sealed but its dependencies are the repositories above
|
||||
// (template/external/notification/inbound + ISiteRepository for M8 site/instance
|
||||
// (template/external/notification/inbound + ISiteRepository for site/instance
|
||||
// export) — registering the concrete type is enough.
|
||||
Services.AddSingleton<DependencyResolver>();
|
||||
Services.AddSingleton<IOptions<TransportOptions>>(
|
||||
@@ -117,6 +118,7 @@ public class TransportExportPageTests : BunitContext
|
||||
// ─────────────────────────────────────────────────────────────────────
|
||||
// Test 1: Step 1 renders the template tree and every flat artifact group.
|
||||
// ─────────────────────────────────────────────────────────────────────
|
||||
/// <summary>Verifies that renders step 1 with template tree and artifact checkboxes.</summary>
|
||||
[Fact]
|
||||
public void Renders_step1_with_template_tree_and_artifact_checkboxes()
|
||||
{
|
||||
@@ -201,6 +203,8 @@ public class TransportExportPageTests : BunitContext
|
||||
// Test 2: Step 2 shows resolved dependencies — auto-included templates pulled
|
||||
// in because a seed template composes them.
|
||||
// ─────────────────────────────────────────────────────────────────────
|
||||
/// <summary>Verifies that step 2 shows resolved dependencies after clicking next.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Step2_shows_resolved_dependencies_after_clicking_next()
|
||||
{
|
||||
@@ -252,6 +256,8 @@ public class TransportExportPageTests : BunitContext
|
||||
// Test 3: Walks the wizard end-to-end and verifies BundleExporter.ExportAsync
|
||||
// is invoked with the user-selected ids and the authenticated identity.
|
||||
// ─────────────────────────────────────────────────────────────────────
|
||||
/// <summary>Verifies that step 4 triggers export async with selected artifacts and user identity.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Step4_triggers_ExportAsync_with_selected_artifacts_and_user_identity()
|
||||
{
|
||||
@@ -318,6 +324,8 @@ public class TransportExportPageTests : BunitContext
|
||||
// doesn't model routing, so we verify the policy itself denies the
|
||||
// principal (the same gate the router consults).
|
||||
// ─────────────────────────────────────────────────────────────────────
|
||||
/// <summary>Verifies that page returns unauthorized for user without design role.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Page_returns_unauthorized_for_user_without_Design_role()
|
||||
{
|
||||
@@ -336,9 +344,10 @@ public class TransportExportPageTests : BunitContext
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────
|
||||
// Test 5 (M8 E1): Step 1 renders the Sites & Instances group, listing each
|
||||
// Test 5: Step 1 renders the Sites & Instances group, listing each
|
||||
// site and (when expanded) its instances.
|
||||
// ─────────────────────────────────────────────────────────────────────
|
||||
/// <summary>Verifies that renders step 1 sites group with sites and instances.</summary>
|
||||
[Fact]
|
||||
public void Renders_step1_sites_group_with_sites_and_instances()
|
||||
{
|
||||
@@ -372,10 +381,12 @@ public class TransportExportPageTests : BunitContext
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────
|
||||
// Test 6 (M8 E1): Selecting a site flows its id into ExportSelection.SiteIds;
|
||||
// Test 6: Selecting a site flows its id into ExportSelection.SiteIds;
|
||||
// selecting an individual instance flows its id into InstanceIds. Verified at
|
||||
// the resolver/exporter boundary (the same contract DependencyResolver reads).
|
||||
// ─────────────────────────────────────────────────────────────────────
|
||||
/// <summary>Verifies that step 4 export carries selected site and instance ids.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Step4_export_carries_selected_site_and_instance_ids()
|
||||
{
|
||||
@@ -441,6 +452,8 @@ public class TransportExportPageTests : BunitContext
|
||||
// AccountSid (never AuthToken), and ticking one flows its entity id into
|
||||
// ExportSelection.SmsConfigurationIds — mirroring the SMTP-by-Host contract.
|
||||
// ─────────────────────────────────────────────────────────────────────
|
||||
/// <summary>Verifies that step 4 export carries selected sms configuration ids.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Step4_export_carries_selected_sms_configuration_ids()
|
||||
{
|
||||
@@ -494,6 +507,7 @@ public class TransportExportPageTests : BunitContext
|
||||
// Test 9 (S10c): CountSecrets counts a populated SMS AuthToken, mirroring
|
||||
// the SMTP Credentials contribution to the Step 3 secrets banner.
|
||||
// ─────────────────────────────────────────────────────────────────────
|
||||
/// <summary>Verifies that count secrets includes sms configuration auth token.</summary>
|
||||
[Fact]
|
||||
public void CountSecrets_includes_sms_configuration_auth_token()
|
||||
{
|
||||
@@ -523,6 +537,7 @@ public class TransportExportPageTests : BunitContext
|
||||
// Static helpers — exercised directly so the file-naming + secret-count
|
||||
// contract is unit-pinned independently of the rendering surface.
|
||||
// ─────────────────────────────────────────────────────────────────────
|
||||
/// <summary>Verifies that build filename produces pattern and sanitises source environment.</summary>
|
||||
[Fact]
|
||||
public void BuildFilename_produces_pattern_and_sanitises_source_environment()
|
||||
{
|
||||
@@ -532,9 +547,10 @@ public class TransportExportPageTests : BunitContext
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────
|
||||
// Test 7 (M8 C2-SECRET-1): CountSecrets includes site data-connection
|
||||
// Test 7: CountSecrets includes site data-connection
|
||||
// PrimaryConfiguration and BackupConfiguration fields in the banner total.
|
||||
// ─────────────────────────────────────────────────────────────────────
|
||||
/// <summary>Verifies that count secrets includes data connection primary and backup configurations.</summary>
|
||||
[Fact]
|
||||
public void CountSecrets_includes_data_connection_primary_and_backup_configurations()
|
||||
{
|
||||
@@ -560,6 +576,7 @@ public class TransportExportPageTests : BunitContext
|
||||
Assert.Equal(2, TransportExportPage.CountSecrets(resolved));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that count secrets counts only non empty data connection configurations.</summary>
|
||||
[Fact]
|
||||
public void CountSecrets_counts_only_non_empty_data_connection_configurations()
|
||||
{
|
||||
@@ -589,6 +606,7 @@ public class TransportExportPageTests : BunitContext
|
||||
Assert.Equal(1, TransportExportPage.CountSecrets(resolved));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that count secrets returns zero when no data connections.</summary>
|
||||
[Fact]
|
||||
public void CountSecrets_returns_zero_when_no_data_connections()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user