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:
@@ -4,13 +4,14 @@ using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts;
|
||||
namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Scripts;
|
||||
|
||||
/// <summary>
|
||||
/// WP-17: Shared Script Library tests — compile, register, execute inline.
|
||||
/// Shared Script Library tests — compile, register, execute inline.
|
||||
/// </summary>
|
||||
public class SharedScriptLibraryTests
|
||||
{
|
||||
private readonly ScriptCompilationService _compilationService;
|
||||
private readonly SharedScriptLibrary _library;
|
||||
|
||||
/// <summary>Initializes a new instance of the <c>SharedScriptLibraryTests</c> class.</summary>
|
||||
public SharedScriptLibraryTests()
|
||||
{
|
||||
_compilationService = new ScriptCompilationService(
|
||||
@@ -19,6 +20,7 @@ public class SharedScriptLibraryTests
|
||||
_compilationService, NullLogger<SharedScriptLibrary>.Instance);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that compile and register valid script succeeds.</summary>
|
||||
[Fact]
|
||||
public void CompileAndRegister_ValidScript_Succeeds()
|
||||
{
|
||||
@@ -27,6 +29,7 @@ public class SharedScriptLibraryTests
|
||||
Assert.True(_library.Contains("add"));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that compile and register invalid script returns false.</summary>
|
||||
[Fact]
|
||||
public void CompileAndRegister_InvalidScript_ReturnsFalse()
|
||||
{
|
||||
@@ -35,6 +38,7 @@ public class SharedScriptLibraryTests
|
||||
Assert.False(_library.Contains("bad"));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that compile and register forbidden api returns false.</summary>
|
||||
[Fact]
|
||||
public void CompileAndRegister_ForbiddenApi_ReturnsFalse()
|
||||
{
|
||||
@@ -42,6 +46,7 @@ public class SharedScriptLibraryTests
|
||||
Assert.False(result);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that compile and register replaces existing script.</summary>
|
||||
[Fact]
|
||||
public void CompileAndRegister_Replaces_ExistingScript()
|
||||
{
|
||||
@@ -53,6 +58,7 @@ public class SharedScriptLibraryTests
|
||||
Assert.Equal(1, _library.GetRegisteredScriptNames().Count(n => n == "calc"));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that remove registered script returns true.</summary>
|
||||
[Fact]
|
||||
public void Remove_RegisteredScript_ReturnsTrue()
|
||||
{
|
||||
@@ -61,12 +67,14 @@ public class SharedScriptLibraryTests
|
||||
Assert.False(_library.Contains("temp"));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that remove nonexistent script returns false.</summary>
|
||||
[Fact]
|
||||
public void Remove_NonexistentScript_ReturnsFalse()
|
||||
{
|
||||
Assert.False(_library.Remove("nonexistent"));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that get registered script names returns all names.</summary>
|
||||
[Fact]
|
||||
public void GetRegisteredScriptNames_ReturnsAllNames()
|
||||
{
|
||||
@@ -81,6 +89,8 @@ public class SharedScriptLibraryTests
|
||||
Assert.Contains("c", names);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that execute async nonexistent script throws.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_NonexistentScript_Throws()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user