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:
Joseph Doherty
2026-10-07 15:05:49 -04:00
parent 0ffd4bdbea
commit 513fa1aa16
998 changed files with 17896 additions and 2395 deletions
@@ -24,6 +24,8 @@ public sealed class EntitySerializerTests
SmtpConfigurations: Array.Empty<SmtpConfiguration>(),
ApiMethods: Array.Empty<ApiMethod>());
/// <summary>Verifies that converting an external system to a DTO carves its credentials into the secrets block.</summary>
/// <returns>The result.</returns>
[Fact]
public void ToDto_carves_external_system_credentials_into_secrets_block()
{
@@ -47,6 +49,8 @@ public sealed class EntitySerializerTests
Assert.Equal("ApiKey", dtoSys.AuthType);
}
/// <summary>Verifies that converting an SMTP config to a DTO carves its password into the secrets block.</summary>
/// <returns>The result.</returns>
[Fact]
public void ToDto_carves_smtp_password_into_secrets_block()
{
@@ -67,6 +71,8 @@ public sealed class EntitySerializerTests
Assert.Equal(587, dtoSmtp.Port);
}
/// <summary>Verifies that a template round trip preserves its attributes, alarms, scripts and compositions.</summary>
/// <returns>The result.</returns>
[Fact]
public void Roundtrip_template_preserves_attributes_alarms_scripts_composition()
{
@@ -99,7 +105,7 @@ public sealed class EntitySerializerTests
TriggerType = AlarmTriggerType.RangeViolation,
TriggerConfiguration = "{\"threshold\":100}",
IsLocked = false,
// FU-B / #37 — alarm fires "OnUpdate" script when triggered. The FK is
// Alarm fires "OnUpdate" script when triggered. The FK is
// an in-aggregate script id; the DTO carries the name and the
// importer resolves the FK on the way back in.
OnTriggerScriptId = 1,
@@ -122,7 +128,7 @@ public sealed class EntitySerializerTests
var sut = new EntitySerializer();
var dto = sut.ToBundleContent(aggregate);
// FU-B / #37 — verify the DTO carries OnTriggerScriptName by NAME (not id).
// Verify the DTO carries OnTriggerScriptName by NAME (not id).
// The bundle is portable across environments so a script-id FK can't
// survive a round-trip; resolution back to a script id is the importer's
// job once the parent template's scripts have been re-persisted.
@@ -159,6 +165,8 @@ public sealed class EntitySerializerTests
Assert.Equal("MotorA", rtComp.InstanceName);
}
/// <summary>Verifies that a template round trip preserves the locked-in-derived flag on attributes, alarms and scripts.</summary>
/// <returns>The result.</returns>
[Fact]
public void Roundtrip_template_preserves_LockedInDerived_on_attribute_alarm_script()
{
@@ -202,6 +210,8 @@ public sealed class EntitySerializerTests
Assert.True(Assert.Single(rtBasic.Scripts).LockedInDerived);
}
/// <summary>Verifies that a template round trip preserves its native alarm sources.</summary>
/// <returns>The result.</returns>
[Fact]
public void Roundtrip_template_preserves_NativeAlarmSources()
{
@@ -244,6 +254,8 @@ public sealed class EntitySerializerTests
Assert.True(rtSrc.LockedInDerived);
}
/// <summary>Verifies that old-form bundle JSON without the locked-in-derived field deserializes it as false.</summary>
/// <returns>The result.</returns>
[Fact]
public void OldForm_bundle_json_without_LockedInDerived_deserializes_to_false()
{
@@ -294,6 +306,8 @@ public sealed class EntitySerializerTests
Assert.False(Assert.Single(template.Scripts).LockedInDerived);
}
/// <summary>Verifies that a round trip preserves the MES-reportable flag on alarms and instance overrides.</summary>
/// <returns>The result.</returns>
[Fact]
public void Roundtrip_preserves_IsMesReportable_on_alarm_and_instance_override()
{
@@ -332,6 +346,8 @@ public sealed class EntitySerializerTests
Assert.False(Assert.Single(Assert.Single(restored.Instances).AlarmOverrides).IsMesReportableOverride);
}
/// <summary>Verifies that old-form bundle JSON without the MES-reportable field deserializes it as false on alarms and null on overrides.</summary>
/// <returns>The result.</returns>
[Fact]
public void OldForm_bundle_json_without_IsMesReportable_deserializes_to_false_and_null()
{
@@ -394,6 +410,8 @@ public sealed class EntitySerializerTests
Assert.Null(over.IsMesReportableOverride);
}
/// <summary>Verifies that a template folder round trip preserves the folder hierarchy.</summary>
/// <returns>The result.</returns>
[Fact]
public void Roundtrip_template_folder_preserves_hierarchy()
{
@@ -419,6 +437,8 @@ public sealed class EntitySerializerTests
Assert.Equal(rtRoot.Id, rtChild.ParentFolderId);
}
/// <summary>Verifies that an external system round trip preserves its retry configuration.</summary>
/// <returns>The result.</returns>
[Fact]
public void Roundtrip_external_system_preserves_retry_config()
{
@@ -441,7 +461,7 @@ public sealed class EntitySerializerTests
}
/// <summary>
/// arch-review 2026-08-19 P7-1 (row-27 shape): <c>TimeoutSeconds</c> is operative at
/// <c>TimeoutSeconds</c> is operative at
/// runtime (the per-system HTTP timeout) but was silently dropped by the export/import
/// DTO — same defect class as the earlier <c>MaxRetries</c>/<c>RetryDelay</c> holes this
/// test's sibling covers.
@@ -494,6 +514,8 @@ public sealed class EntitySerializerTests
Assert.Equal(0, sys.TimeoutSeconds);
}
/// <summary>Verifies that converting a DTO with a null secrets block yields an entity with default empty secrets.</summary>
/// <returns>The result.</returns>
[Fact]
public void FromDto_with_null_SecretsBlock_yields_entity_with_default_empty_secrets()
{
@@ -516,6 +538,8 @@ public sealed class EntitySerializerTests
Assert.Null(sys.AuthConfiguration);
}
/// <summary>Verifies that a list attribute round trip preserves its element data type.</summary>
/// <returns>The result.</returns>
[Fact]
public void Roundtrip_List_attribute_preserves_ElementDataType()
{
@@ -585,6 +609,8 @@ public sealed class EntitySerializerTests
ApiMethods: Array.Empty<ApiMethodDto>());
}
/// <summary>Verifies that import normalizes an old-form Int32 list value to native JSON.</summary>
/// <returns>The result.</returns>
[Fact]
public void Import_normalizes_old_form_Int32_list_value_to_native_json()
{
@@ -600,6 +626,8 @@ public sealed class EntitySerializerTests
Assert.Equal("[10,20]", attr.Value);
}
/// <summary>Verifies that import leaves a string list value quoted.</summary>
/// <returns>The result.</returns>
[Fact]
public void Import_leaves_string_list_value_quoted()
{
@@ -614,6 +642,8 @@ public sealed class EntitySerializerTests
Assert.Equal("[\"a\",\"b\"]", attr.Value);
}
/// <summary>Verifies that import leaves a malformed list value unchanged without throwing.</summary>
/// <returns>The result.</returns>
[Fact]
public void Import_leaves_malformed_list_value_unchanged_without_throwing()
{
@@ -628,6 +658,8 @@ public sealed class EntitySerializerTests
Assert.Equal("[\"a\"", attr.Value);
}
/// <summary>Verifies that import leaves a scalar attribute value unchanged.</summary>
/// <returns>The result.</returns>
[Fact]
public void Import_leaves_scalar_attribute_value_unchanged()
{
@@ -667,6 +699,8 @@ public sealed class EntitySerializerTests
Assert.Equal("42.0", attr.Value);
}
/// <summary>Verifies that a scalar attribute round trip keeps a null element data type as null.</summary>
/// <returns>The result.</returns>
[Fact]
public void Roundtrip_scalar_attribute_with_null_ElementDataType_remains_null()
{
@@ -699,7 +733,7 @@ public sealed class EntitySerializerTests
Assert.Null(rtAttr.ElementDataType);
}
// --- M8 (B2): site / data-connection / instance mapping ------------------
// --- Site / data-connection / instance mapping ------------------
/// <summary>
/// Builds a populated aggregate: one template (so the instance's TemplateName
@@ -768,6 +802,8 @@ public sealed class EntitySerializerTests
};
}
/// <summary>Verifies that converting a site, connection and instance to DTOs maps secrets and name links.</summary>
/// <returns>The result.</returns>
[Fact]
public void ToDto_maps_site_connection_instance_with_secrets_and_name_links()
{
@@ -831,6 +867,8 @@ public sealed class EntitySerializerTests
Assert.Equal("ns=2;s=Pump1.P", dtoBinding.DataSourceReferenceOverride);
}
/// <summary>Verifies that converting a connection to a DTO omits the secret key when the backup configuration is empty.</summary>
/// <returns>The result.</returns>
[Fact]
public void ToDto_omits_secret_key_when_backup_configuration_is_empty()
{
@@ -857,6 +895,8 @@ public sealed class EntitySerializerTests
Assert.False(dtoConn.Secrets.Values.ContainsKey("BackupConfiguration"));
}
/// <summary>Verifies that a site, connection and instance round trip restores configuration from the secrets and binding names.</summary>
/// <returns>The result.</returns>
[Fact]
public void Roundtrip_site_connection_instance_restores_config_from_secrets_and_binding_name()
{
@@ -911,6 +951,8 @@ public sealed class EntitySerializerTests
// --- S10: SMS recipient PhoneNumber + SmsConfiguration round-trip ---------
/// <summary>Verifies that converting an SMS recipient to a DTO carries its phone number.</summary>
/// <returns>The result.</returns>
[Fact]
public void ToDto_carries_sms_recipient_phone_number()
{
@@ -930,6 +972,8 @@ public sealed class EntitySerializerTests
Assert.Null(dtoRecipient.EmailAddress);
}
/// <summary>Verifies that an SMS recipient round trip preserves the phone number.</summary>
/// <returns>The result.</returns>
[Fact]
public void Roundtrip_sms_recipient_preserves_phone_number()
{
@@ -948,6 +992,8 @@ public sealed class EntitySerializerTests
Assert.Null(rtRecipient.EmailAddress);
}
/// <summary>Verifies that an email recipient round trip preserves the email address and leaves the phone number null.</summary>
/// <returns>The result.</returns>
[Fact]
public void Roundtrip_email_recipient_preserves_email_and_leaves_phone_null()
{
@@ -969,6 +1015,8 @@ public sealed class EntitySerializerTests
Assert.Null(rtRecipient.PhoneNumber);
}
/// <summary>Verifies that a recipient round trip preserves both the email address and the phone number.</summary>
/// <returns>The result.</returns>
[Fact]
public void Roundtrip_recipient_with_both_contacts_preserves_both()
{
@@ -989,6 +1037,8 @@ public sealed class EntitySerializerTests
Assert.Equal("+15559876543", rtRecipient.PhoneNumber);
}
/// <summary>Verifies that converting a recipient DTO without a phone number yields a null phone number.</summary>
/// <returns>The result.</returns>
[Fact]
public void FromDto_recipient_without_phone_number_yields_null_phone()
{
@@ -1017,6 +1067,8 @@ public sealed class EntitySerializerTests
Assert.Null(recipient.PhoneNumber);
}
/// <summary>Verifies that converting an SMS config to a DTO carves its auth token into the secrets block.</summary>
/// <returns>The result.</returns>
[Fact]
public void ToDto_carves_sms_auth_token_into_secrets_block()
{
@@ -1045,6 +1097,8 @@ public sealed class EntitySerializerTests
Assert.DoesNotContain("twilio-super-secret", dtoSms.FromNumber);
}
/// <summary>Verifies that an SMS config round trip restores the auth token from the secrets block.</summary>
/// <returns>The result.</returns>
[Fact]
public void Roundtrip_sms_config_restores_auth_token_from_secrets_block()
{
@@ -1075,6 +1129,8 @@ public sealed class EntitySerializerTests
Assert.Equal("twilio-super-secret", rtSms.AuthToken);
}
/// <summary>Verifies that converting an SMS config to a DTO omits the secret key when the auth token is null.</summary>
/// <returns>The result.</returns>
[Fact]
public void ToDto_omits_sms_secret_key_when_auth_token_is_null()
{
@@ -1095,6 +1151,8 @@ public sealed class EntitySerializerTests
// --- EWS: Transport + the pre-existing OAuth2 authority/scope drop ---------
/// <summary>Verifies that an SMTP config round trip preserves the transport and OAuth2 fields.</summary>
/// <returns>The result.</returns>
[Fact]
public void Roundtrip_smtp_config_preserves_transport_and_oauth2_fields()
{
@@ -1143,6 +1201,8 @@ public sealed class EntitySerializerTests
Assert.Equal(TimeSpan.FromSeconds(90), rtSmtp.RetryDelay);
}
/// <summary>Verifies that converting an SMTP config DTO without transport or OAuth2 fields yields nulls.</summary>
/// <returns>The result.</returns>
[Fact]
public void FromDto_smtp_config_without_transport_or_oauth2_fields_yields_nulls()
{
@@ -1182,6 +1242,8 @@ public sealed class EntitySerializerTests
Assert.Equal("smtp.example.com", smtp.Host);
}
/// <summary>Verifies that an SMTP config DTO omits null transport and OAuth2 fields from its JSON.</summary>
/// <returns>The result.</returns>
[Fact]
public void SmtpConfigDto_omits_null_transport_and_oauth2_fields_from_json()
{