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:
@@ -23,6 +23,7 @@ public class SiteCallTests
|
||||
IngestedAtUtc = new DateTime(2026, 5, 23, 12, 0, 1, DateTimeKind.Utc),
|
||||
};
|
||||
|
||||
/// <summary>Verifies that a site call carries its source node.</summary>
|
||||
[Fact]
|
||||
public void SiteCall_carries_SourceNode()
|
||||
{
|
||||
|
||||
@@ -12,6 +12,7 @@ public class EntityConventionTests
|
||||
.Where(t => t.IsClass && !t.IsAbstract && t.Namespace != null
|
||||
&& t.Namespace.Contains(".Entities."));
|
||||
|
||||
/// <summary>Verifies that no entity class carries Entity Framework attributes.</summary>
|
||||
[Fact]
|
||||
public void AllEntities_ShouldHaveNoEfAttributes()
|
||||
{
|
||||
@@ -45,6 +46,7 @@ public class EntityConventionTests
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Verifies that every timestamp property on an entity is a DateTimeOffset.</summary>
|
||||
[Fact]
|
||||
public void AllTimestampProperties_ShouldBeDateTimeOffset()
|
||||
{
|
||||
@@ -68,6 +70,7 @@ public class EntityConventionTests
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Verifies that collection navigation properties on entities are declared as ICollection.</summary>
|
||||
[Fact]
|
||||
public void NavigationProperties_ShouldBeICollection()
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Entities;
|
||||
/// </summary>
|
||||
public class ExternalSystemDefinitionTests
|
||||
{
|
||||
/// <summary>Verifies that the timeout seconds default to zero, meaning the gateway default is used.</summary>
|
||||
[Fact]
|
||||
public void ExternalSystemDefinition_TimeoutSeconds_DefaultsToZeroMeaningUseGatewayDefault()
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Entities;
|
||||
|
||||
public class NativeAlarmSourceEntityTests
|
||||
{
|
||||
/// <summary>Verifies that a template native alarm source is constructed with its required name.</summary>
|
||||
[Fact]
|
||||
public void TemplateNativeAlarmSource_RequiresName()
|
||||
{
|
||||
@@ -13,6 +14,7 @@ public class NativeAlarmSourceEntityTests
|
||||
Assert.False(s.IsLocked);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a flattened configuration has an empty native alarm source list by default.</summary>
|
||||
[Fact]
|
||||
public void FlattenedConfiguration_HasNativeAlarmSourcesDefaultEmpty()
|
||||
{
|
||||
@@ -20,6 +22,7 @@ public class NativeAlarmSourceEntityTests
|
||||
Assert.Empty(f.NativeAlarmSources);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a resolved native alarm source has a default source template value.</summary>
|
||||
[Fact]
|
||||
public void ResolvedNativeAlarmSource_DefaultsSourceTemplate()
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Entities;
|
||||
/// </summary>
|
||||
public class NotificationEntityTests
|
||||
{
|
||||
/// <summary>Verifies that the constructor sets the expected default values.</summary>
|
||||
[Fact]
|
||||
public void Constructor_SetsDefaults()
|
||||
{
|
||||
@@ -21,10 +22,11 @@ public class NotificationEntityTests
|
||||
Assert.Equal("SiteA", n.SourceSiteId);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that OriginExecutionId defaults to null and can be set.</summary>
|
||||
[Fact]
|
||||
public void OriginExecutionId_DefaultsToNull_AndIsSettable()
|
||||
{
|
||||
// Audit Log #23: OriginExecutionId carries the originating script
|
||||
// OriginExecutionId carries the originating script
|
||||
// execution's id from the site so the dispatcher can echo it onto
|
||||
// NotifyDeliver rows. Null for notifications submitted before the
|
||||
// column existed; settable from the NotificationSubmit message.
|
||||
@@ -36,6 +38,7 @@ public class NotificationEntityTests
|
||||
Assert.Equal(executionId, n.OriginExecutionId);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that OriginParentExecutionId defaults to null and can be set.</summary>
|
||||
[Fact]
|
||||
public void OriginParentExecutionId_DefaultsToNull_AndIsSettable()
|
||||
{
|
||||
@@ -51,6 +54,7 @@ public class NotificationEntityTests
|
||||
Assert.Equal(parentExecutionId, n.OriginParentExecutionId);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that SourceNode defaults to null and can be set.</summary>
|
||||
[Fact]
|
||||
public void SourceNode_DefaultsToNull_AndIsSettable()
|
||||
{
|
||||
@@ -65,6 +69,7 @@ public class NotificationEntityTests
|
||||
Assert.Equal("node-a", n.SourceNode);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the constructor throws for null arguments.</summary>
|
||||
[Fact]
|
||||
public void Constructor_NullArguments_Throw()
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@ namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Entities;
|
||||
/// </summary>
|
||||
public class NotificationRecipientTests
|
||||
{
|
||||
/// <summary>Verifies that creating an email recipient sets the email address and leaves the phone number null.</summary>
|
||||
[Fact]
|
||||
public void ForEmail_SetsEmail_LeavesPhoneNull()
|
||||
{
|
||||
@@ -18,6 +19,7 @@ public class NotificationRecipientTests
|
||||
Assert.Null(r.PhoneNumber);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that creating an SMS recipient sets the phone number and leaves the email address null.</summary>
|
||||
[Fact]
|
||||
public void ForSms_SetsPhone_LeavesEmailNull()
|
||||
{
|
||||
@@ -28,6 +30,8 @@ public class NotificationRecipientTests
|
||||
Assert.Null(r.EmailAddress);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that creating an email recipient with a blank name throws.</summary>
|
||||
/// <param name="name">The blank recipient name.</param>
|
||||
[Theory]
|
||||
[InlineData(null)]
|
||||
[InlineData("")]
|
||||
@@ -35,6 +39,8 @@ public class NotificationRecipientTests
|
||||
public void ForEmail_BlankName_Throws(string? name)
|
||||
=> Assert.Throws<ArgumentException>(() => NotificationRecipient.ForEmail(name!, "jane@example.com"));
|
||||
|
||||
/// <summary>Verifies that creating an SMS recipient with a blank name throws.</summary>
|
||||
/// <param name="name">The blank recipient name.</param>
|
||||
[Theory]
|
||||
[InlineData(null)]
|
||||
[InlineData("")]
|
||||
@@ -42,14 +48,18 @@ public class NotificationRecipientTests
|
||||
public void ForSms_BlankName_Throws(string? name)
|
||||
=> Assert.Throws<ArgumentException>(() => NotificationRecipient.ForSms(name!, "+15551234567"));
|
||||
|
||||
/// <summary>Verifies that creating an email recipient with a null email address throws.</summary>
|
||||
[Fact]
|
||||
public void ForEmail_NullEmail_Throws()
|
||||
=> Assert.Throws<ArgumentNullException>(() => NotificationRecipient.ForEmail("Jane", null!));
|
||||
|
||||
/// <summary>Verifies that creating an SMS recipient with a null phone number throws.</summary>
|
||||
[Fact]
|
||||
public void ForSms_NullPhone_Throws()
|
||||
=> Assert.Throws<ArgumentNullException>(() => NotificationRecipient.ForSms("Jane", null!));
|
||||
|
||||
/// <summary>Verifies that the public constructor throws for a blank name.</summary>
|
||||
/// <param name="name">The blank recipient name.</param>
|
||||
[Theory]
|
||||
[InlineData(null)]
|
||||
[InlineData("")]
|
||||
@@ -57,6 +67,7 @@ public class NotificationRecipientTests
|
||||
public void PublicCtor_BlankName_Throws(string? name)
|
||||
=> Assert.Throws<ArgumentException>(() => new NotificationRecipient(name!, "jane@example.com"));
|
||||
|
||||
/// <summary>Verifies that the public constructor throws for a null email address.</summary>
|
||||
[Fact]
|
||||
public void PublicCtor_NullEmail_Throws()
|
||||
=> Assert.Throws<ArgumentNullException>(() => new NotificationRecipient("Jane", null!));
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Entities;
|
||||
|
||||
public class TemplateFolderTests
|
||||
{
|
||||
/// <summary>Verifies that the constructor sets the folder name.</summary>
|
||||
[Fact]
|
||||
public void Constructor_SetsName()
|
||||
{
|
||||
@@ -15,12 +16,14 @@ public class TemplateFolderTests
|
||||
Assert.Equal(0, folder.SortOrder);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the constructor throws when the name is null.</summary>
|
||||
[Fact]
|
||||
public void Constructor_NullName_Throws()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new TemplateFolder(null!));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a template's folder id defaults to null.</summary>
|
||||
[Fact]
|
||||
public void Template_FolderId_DefaultsToNull()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user