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:
+7
@@ -12,6 +12,7 @@ public class MxGatewayEndpointConfigValidatorTests
|
||||
ApiKey = "key",
|
||||
};
|
||||
|
||||
/// <summary>Verifies that a valid config passes validation.</summary>
|
||||
[Fact]
|
||||
public void Validate_ValidConfig_IsValid()
|
||||
{
|
||||
@@ -20,6 +21,7 @@ public class MxGatewayEndpointConfigValidatorTests
|
||||
Assert.Empty(result.Errors);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a missing endpoint fails validation.</summary>
|
||||
[Fact]
|
||||
public void Validate_MissingEndpoint_Fails()
|
||||
{
|
||||
@@ -33,6 +35,8 @@ public class MxGatewayEndpointConfigValidatorTests
|
||||
&& e.Message.Contains("required", StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an endpoint with an unsupported scheme fails validation.</summary>
|
||||
/// <param name="url">The endpoint URL with the bad scheme.</param>
|
||||
[Theory]
|
||||
[InlineData("opc.tcp://x:4840")]
|
||||
[InlineData("ftp://x")]
|
||||
@@ -46,6 +50,7 @@ public class MxGatewayEndpointConfigValidatorTests
|
||||
Assert.Contains(r.Errors, e => e.EntityName == "Endpoint");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a missing API key fails validation.</summary>
|
||||
[Fact]
|
||||
public void Validate_MissingApiKey_Fails()
|
||||
{
|
||||
@@ -56,6 +61,7 @@ public class MxGatewayEndpointConfigValidatorTests
|
||||
Assert.Contains(r.Errors, e => e.EntityName == "ApiKey");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a non-positive read timeout fails validation.</summary>
|
||||
[Fact]
|
||||
public void Validate_NonPositiveReadTimeout_Fails()
|
||||
{
|
||||
@@ -66,6 +72,7 @@ public class MxGatewayEndpointConfigValidatorTests
|
||||
Assert.Contains(r.Errors, e => e.EntityName == "ReadTimeoutMs");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that prefixed field names appear in the validation errors.</summary>
|
||||
[Fact]
|
||||
public void Validate_PrefixedFieldNames_AppearInErrors()
|
||||
{
|
||||
|
||||
+19
@@ -12,6 +12,7 @@ public class OpcUaEndpointConfigValidatorTests
|
||||
// Defaults satisfy the spec: Lifetime(30) >= 3 * KeepAlive(10).
|
||||
};
|
||||
|
||||
/// <summary>Verifies that the default settings with a valid endpoint URL validate successfully.</summary>
|
||||
[Fact]
|
||||
public void Validate_DefaultsWithValidUrl_IsValid()
|
||||
{
|
||||
@@ -20,6 +21,7 @@ public class OpcUaEndpointConfigValidatorTests
|
||||
Assert.Empty(result.Errors);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a missing endpoint URL fails validation.</summary>
|
||||
[Fact]
|
||||
public void Validate_MissingEndpointUrl_Fails()
|
||||
{
|
||||
@@ -33,6 +35,8 @@ public class OpcUaEndpointConfigValidatorTests
|
||||
&& e.Message.Contains("required", StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a malformed or non-OPC UA endpoint URL fails validation.</summary>
|
||||
/// <param name="url">The invalid endpoint URL to validate.</param>
|
||||
[Theory]
|
||||
[InlineData("http://x")]
|
||||
[InlineData("opc.tcp://")]
|
||||
@@ -46,6 +50,7 @@ public class OpcUaEndpointConfigValidatorTests
|
||||
Assert.Contains(r.Errors, e => e.EntityName == "EndpointUrl");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a lifetime count below three times the keep-alive count fails validation.</summary>
|
||||
[Fact]
|
||||
public void Validate_LifetimeLessThanThreeTimesKeepAlive_Fails()
|
||||
{
|
||||
@@ -57,6 +62,8 @@ public class OpcUaEndpointConfigValidatorTests
|
||||
Assert.Contains(r.Errors, e => e.EntityName == "LifetimeCount");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a non-positive timing value fails validation.</summary>
|
||||
/// <param name="field">The name of the timing field set to a non-positive value.</param>
|
||||
[Theory]
|
||||
[InlineData(nameof(OpcUaEndpointConfig.SessionTimeoutMs))]
|
||||
[InlineData(nameof(OpcUaEndpointConfig.OperationTimeoutMs))]
|
||||
@@ -71,6 +78,7 @@ public class OpcUaEndpointConfigValidatorTests
|
||||
Assert.Contains(r.Errors, e => e.EntityName == field);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a queue size of zero fails validation.</summary>
|
||||
[Fact]
|
||||
public void Validate_QueueSizeZero_Fails()
|
||||
{
|
||||
@@ -80,6 +88,7 @@ public class OpcUaEndpointConfigValidatorTests
|
||||
Assert.Contains(r.Errors, e => e.EntityName == "QueueSize");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that enabling the heartbeat without a tag path fails validation.</summary>
|
||||
[Fact]
|
||||
public void Validate_HeartbeatEnabledNoTagPath_Fails()
|
||||
{
|
||||
@@ -89,6 +98,7 @@ public class OpcUaEndpointConfigValidatorTests
|
||||
Assert.Contains(r.Errors, e => e.EntityName == "Heartbeat.TagPath");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a non-positive heartbeat silence threshold fails validation.</summary>
|
||||
[Fact]
|
||||
public void Validate_HeartbeatNonPositiveSilence_Fails()
|
||||
{
|
||||
@@ -98,6 +108,7 @@ public class OpcUaEndpointConfigValidatorTests
|
||||
Assert.Contains(r.Errors, e => e.EntityName == "Heartbeat.MaxSilenceSeconds");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the field prefix is applied to every validation error.</summary>
|
||||
[Fact]
|
||||
public void Validate_FieldPrefix_AppliedToEveryError()
|
||||
{
|
||||
@@ -112,6 +123,7 @@ public class OpcUaEndpointConfigValidatorTests
|
||||
|
||||
// ── Layer B extensions: auth, deadband, subscription display name ──
|
||||
|
||||
/// <summary>Verifies that an empty subscription display name fails validation.</summary>
|
||||
[Fact]
|
||||
public void Validate_EmptySubscriptionDisplayName_Fails()
|
||||
{
|
||||
@@ -121,6 +133,7 @@ public class OpcUaEndpointConfigValidatorTests
|
||||
Assert.Contains(r.Errors, e => e.EntityName == "SubscriptionDisplayName");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an anonymous user identity requires no additional fields.</summary>
|
||||
[Fact]
|
||||
public void Validate_UserIdentityAnonymous_NoExtraFieldsRequired()
|
||||
{
|
||||
@@ -130,6 +143,7 @@ public class OpcUaEndpointConfigValidatorTests
|
||||
Assert.True(r.IsValid);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a username/password identity without a username fails validation.</summary>
|
||||
[Fact]
|
||||
public void Validate_UsernamePasswordWithoutUsername_Fails()
|
||||
{
|
||||
@@ -144,6 +158,7 @@ public class OpcUaEndpointConfigValidatorTests
|
||||
Assert.Contains(r.Errors, e => e.EntityName == "UserIdentity.Username");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an X.509 identity without a certificate path fails validation.</summary>
|
||||
[Fact]
|
||||
public void Validate_X509WithoutCertificatePath_Fails()
|
||||
{
|
||||
@@ -157,6 +172,7 @@ public class OpcUaEndpointConfigValidatorTests
|
||||
Assert.Contains(r.Errors, e => e.EntityName == "UserIdentity.CertificatePath");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a username/password identity with a username passes validation.</summary>
|
||||
[Fact]
|
||||
public void Validate_UsernamePasswordWithUsername_Passes()
|
||||
{
|
||||
@@ -171,6 +187,7 @@ public class OpcUaEndpointConfigValidatorTests
|
||||
Assert.True(r.IsValid);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a deadband with a non-positive value fails validation.</summary>
|
||||
[Fact]
|
||||
public void Validate_DeadbandWithNonPositiveValue_Fails()
|
||||
{
|
||||
@@ -180,6 +197,7 @@ public class OpcUaEndpointConfigValidatorTests
|
||||
Assert.Contains(r.Errors, e => e.EntityName == "Deadband.Value");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a deadband with a positive value passes validation.</summary>
|
||||
[Fact]
|
||||
public void Validate_DeadbandWithPositiveValue_Passes()
|
||||
{
|
||||
@@ -189,6 +207,7 @@ public class OpcUaEndpointConfigValidatorTests
|
||||
Assert.True(r.IsValid);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that user identity errors carry the field prefix.</summary>
|
||||
[Fact]
|
||||
public void Validate_UserIdentityErrorsPrefixed_WithFieldPrefix()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user