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:
@@ -6,9 +6,10 @@ namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests;
|
||||
public class LockEnforcerTests
|
||||
{
|
||||
// ========================================================================
|
||||
// WP-8: Override Granularity
|
||||
// Override Granularity
|
||||
// ========================================================================
|
||||
|
||||
/// <summary>Verifies that overriding a locked attribute returns an error.</summary>
|
||||
[Fact]
|
||||
public void ValidateAttributeOverride_LockedAttribute_ReturnsError()
|
||||
{
|
||||
@@ -27,6 +28,7 @@ public class LockEnforcerTests
|
||||
Assert.Contains("locked", result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that changing the data type in an attribute override returns an error.</summary>
|
||||
[Fact]
|
||||
public void ValidateAttributeOverride_DataTypeChanged_ReturnsError()
|
||||
{
|
||||
@@ -45,6 +47,7 @@ public class LockEnforcerTests
|
||||
Assert.Contains("DataType", result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that changing the data source reference in an attribute override returns an error.</summary>
|
||||
[Fact]
|
||||
public void ValidateAttributeOverride_DataSourceReferenceChanged_ReturnsError()
|
||||
{
|
||||
@@ -63,6 +66,7 @@ public class LockEnforcerTests
|
||||
Assert.Contains("DataSourceReference", result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that changing only the value and description in an attribute override returns null.</summary>
|
||||
[Fact]
|
||||
public void ValidateAttributeOverride_ValueAndDescriptionChanged_ReturnsNull()
|
||||
{
|
||||
@@ -80,10 +84,11 @@ public class LockEnforcerTests
|
||||
Assert.Null(result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that changing the element data type in an attribute override returns an error.</summary>
|
||||
[Fact]
|
||||
public void ValidateAttributeOverride_ElementDataTypeChanged_ReturnsError()
|
||||
{
|
||||
// MV-10 review fix: ElementDataType is the element scalar type of a List
|
||||
// ElementDataType is the element scalar type of a List
|
||||
// attribute and is fixed by the defining level, exactly like DataType.
|
||||
// TemplateService.UpdateAttributeAsync never copies it onto the persisted
|
||||
// row, so a mismatch must be rejected before the Value (validated against
|
||||
@@ -103,6 +108,7 @@ public class LockEnforcerTests
|
||||
Assert.Contains("ElementDataType", result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a matching element data type returns null.</summary>
|
||||
[Fact]
|
||||
public void ValidateAttributeOverride_ElementDataTypeMatches_ReturnsNull()
|
||||
{
|
||||
@@ -120,6 +126,7 @@ public class LockEnforcerTests
|
||||
Assert.Null(result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that both element data types being null returns null.</summary>
|
||||
[Fact]
|
||||
public void ValidateAttributeOverride_ElementDataTypeBothNull_ReturnsNull()
|
||||
{
|
||||
@@ -138,6 +145,7 @@ public class LockEnforcerTests
|
||||
Assert.Null(result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that overriding a locked alarm returns an error.</summary>
|
||||
[Fact]
|
||||
public void ValidateAlarmOverride_LockedAlarm_ReturnsError()
|
||||
{
|
||||
@@ -156,6 +164,7 @@ public class LockEnforcerTests
|
||||
Assert.Contains("locked", result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that changing the trigger type in an alarm override returns an error.</summary>
|
||||
[Fact]
|
||||
public void ValidateAlarmOverride_TriggerTypeChanged_ReturnsError()
|
||||
{
|
||||
@@ -174,6 +183,7 @@ public class LockEnforcerTests
|
||||
Assert.Contains("TriggerType", result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that changing the overridable fields of an alarm returns null.</summary>
|
||||
[Fact]
|
||||
public void ValidateAlarmOverride_OverridableFieldsChanged_ReturnsNull()
|
||||
{
|
||||
@@ -193,6 +203,7 @@ public class LockEnforcerTests
|
||||
Assert.Null(result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that overriding a locked script returns an error.</summary>
|
||||
[Fact]
|
||||
public void ValidateScriptOverride_LockedScript_ReturnsError()
|
||||
{
|
||||
@@ -205,6 +216,7 @@ public class LockEnforcerTests
|
||||
Assert.Contains("locked", result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that changing the name in a script override returns an error.</summary>
|
||||
[Fact]
|
||||
public void ValidateScriptOverride_NameChanged_ReturnsError()
|
||||
{
|
||||
@@ -217,6 +229,7 @@ public class LockEnforcerTests
|
||||
Assert.Contains("Name", result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that changing the overridable fields of a script returns null.</summary>
|
||||
[Fact]
|
||||
public void ValidateScriptOverride_OverridableFieldsChanged_ReturnsNull()
|
||||
{
|
||||
@@ -234,9 +247,10 @@ public class LockEnforcerTests
|
||||
}
|
||||
|
||||
// ========================================================================
|
||||
// WP-9: Locking Rules
|
||||
// Locking Rules
|
||||
// ========================================================================
|
||||
|
||||
/// <summary>Verifies that unlocking a locked member returns an error.</summary>
|
||||
[Fact]
|
||||
public void ValidateLockChange_UnlockLocked_ReturnsError()
|
||||
{
|
||||
@@ -246,6 +260,7 @@ public class LockEnforcerTests
|
||||
Assert.Contains("cannot be unlocked", result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that locking an unlocked member returns null.</summary>
|
||||
[Fact]
|
||||
public void ValidateLockChange_LockUnlocked_ReturnsNull()
|
||||
{
|
||||
@@ -254,6 +269,7 @@ public class LockEnforcerTests
|
||||
Assert.Null(result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that keeping a member locked returns null.</summary>
|
||||
[Fact]
|
||||
public void ValidateLockChange_KeepLocked_ReturnsNull()
|
||||
{
|
||||
@@ -262,6 +278,7 @@ public class LockEnforcerTests
|
||||
Assert.Null(result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that keeping a member unlocked returns null.</summary>
|
||||
[Fact]
|
||||
public void ValidateLockChange_KeepUnlocked_ReturnsNull()
|
||||
{
|
||||
@@ -271,9 +288,10 @@ public class LockEnforcerTests
|
||||
}
|
||||
|
||||
// ========================================================================
|
||||
// TemplateEngine-022: LockedInDerived one-way ratchet
|
||||
// LockedInDerived one-way ratchet
|
||||
// ========================================================================
|
||||
|
||||
/// <summary>Verifies that clearing LockedInDerived returns an error.</summary>
|
||||
[Fact]
|
||||
public void ValidateLockedInDerivedChange_ClearLocked_ReturnsError()
|
||||
{
|
||||
@@ -287,6 +305,7 @@ public class LockEnforcerTests
|
||||
Assert.Contains("cannot be cleared", result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that setting LockedInDerived on an unlocked member returns null.</summary>
|
||||
[Fact]
|
||||
public void ValidateLockedInDerivedChange_LockUnlocked_ReturnsNull()
|
||||
{
|
||||
@@ -296,6 +315,7 @@ public class LockEnforcerTests
|
||||
Assert.Null(result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that keeping LockedInDerived set returns null.</summary>
|
||||
[Fact]
|
||||
public void ValidateLockedInDerivedChange_KeepLocked_ReturnsNull()
|
||||
{
|
||||
@@ -304,6 +324,7 @@ public class LockEnforcerTests
|
||||
Assert.Null(result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that keeping LockedInDerived unset returns null.</summary>
|
||||
[Fact]
|
||||
public void ValidateLockedInDerivedChange_KeepUnlocked_ReturnsNull()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user