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:
@@ -26,6 +26,7 @@ public class TemplatesPageTests : BunitContext
|
||||
private readonly ITemplateEngineRepository _repo = Substitute.For<ITemplateEngineRepository>();
|
||||
private readonly IAuditService _audit = Substitute.For<IAuditService>();
|
||||
|
||||
/// <summary>Creates the test class and registers the stubbed services the page needs.</summary>
|
||||
public TemplatesPageTests()
|
||||
{
|
||||
// The page's TemplateService / TemplateFolderService are constructed via DI
|
||||
@@ -64,6 +65,7 @@ public class TemplatesPageTests : BunitContext
|
||||
Services.AddTestConfigurationMutations();
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the page renders an empty state when there are no templates or folders.</summary>
|
||||
[Fact]
|
||||
public void Renders_EmptyState_WhenNoTemplatesOrFolders()
|
||||
{
|
||||
@@ -77,6 +79,7 @@ public class TemplatesPageTests : BunitContext
|
||||
Assert.Contains("No templates yet", cut.Markup);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a folder and its template render at the correct nesting.</summary>
|
||||
[Fact]
|
||||
public void Renders_FolderAndTemplate_AtCorrectNesting()
|
||||
{
|
||||
@@ -102,6 +105,7 @@ public class TemplatesPageTests : BunitContext
|
||||
Assert.Contains("TestMachine", cut.Markup);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that composition children render under their owning template.</summary>
|
||||
[Fact]
|
||||
public void Renders_CompositionChildren_UnderOwningTemplate()
|
||||
{
|
||||
@@ -131,10 +135,11 @@ public class TemplatesPageTests : BunitContext
|
||||
Assert.Contains("bi-arrow-return-right", cut.Markup);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an inherited composition renders under the derived composed member.</summary>
|
||||
[Fact]
|
||||
public void Renders_InheritedComposition_UnderDerivedComposedMember()
|
||||
{
|
||||
// followup #9: LeakTest is composed onto the BASE ReactorSide. LeftReactorSide is
|
||||
// LeakTest is composed onto the BASE ReactorSide. LeftReactorSide is
|
||||
// DERIVED from ReactorSide and composed into CvdReactor, so the tree must surface
|
||||
// the INHERITED LeakTest slot under LeftReactorSide — the composition row lives on
|
||||
// ReactorSide (no IsInherited placeholder on the child), so the builder must use
|
||||
@@ -176,6 +181,7 @@ public class TemplatesPageTests : BunitContext
|
||||
Assert.Contains("inherited", leftLiAfter.TextContent);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the search box is present and bound to the template tree filter.</summary>
|
||||
[Fact]
|
||||
public void SearchBox_IsPresentAndBound_ToTemplateFolderTreeFilter()
|
||||
{
|
||||
@@ -226,7 +232,7 @@ public class TemplatesPageTests : BunitContext
|
||||
}
|
||||
|
||||
// ========================================================================
|
||||
// M9-T23b: folder sibling reorder menu items + root context menu
|
||||
// Folder sibling reorder menu items + root context menu
|
||||
// ========================================================================
|
||||
|
||||
// Seeds two root sibling folders (Alpha @ SortOrder 0, Beta @ SortOrder 1) and
|
||||
@@ -258,6 +264,7 @@ public class TemplatesPageTests : BunitContext
|
||||
return cut.Find(".dropdown-menu.show");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the folder context menu exposes move up and move down items.</summary>
|
||||
[Fact]
|
||||
public void FolderContextMenu_ExposesMoveUpAndMoveDown()
|
||||
{
|
||||
@@ -272,6 +279,7 @@ public class TemplatesPageTests : BunitContext
|
||||
Assert.Contains("Move down", labels);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that choosing move down dispatches a reorder down and reloads the tree.</summary>
|
||||
[Fact]
|
||||
public void FolderContextMenu_MoveDown_DispatchesReorderDown_AndReloads()
|
||||
{
|
||||
@@ -302,6 +310,7 @@ public class TemplatesPageTests : BunitContext
|
||||
_repo.Received(2).GetAllTemplatesAsync(Arg.Any<CancellationToken>());
|
||||
}
|
||||
|
||||
/// <summary>Verifies that choosing move up dispatches a reorder up and reloads the tree.</summary>
|
||||
[Fact]
|
||||
public void FolderContextMenu_MoveUp_DispatchesReorderUp_AndReloads()
|
||||
{
|
||||
@@ -327,6 +336,7 @@ public class TemplatesPageTests : BunitContext
|
||||
_repo.Received(2).GetAllTemplatesAsync(Arg.Any<CancellationToken>());
|
||||
}
|
||||
|
||||
/// <summary>Verifies that move up is disabled for the first sibling folder.</summary>
|
||||
[Fact]
|
||||
public void FolderContextMenu_MoveUp_IsDisabled_OnFirstSibling()
|
||||
{
|
||||
@@ -342,6 +352,7 @@ public class TemplatesPageTests : BunitContext
|
||||
Assert.True(moveUpBtn.HasAttribute("disabled"), "Move up should be disabled for the first sibling");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that move down is disabled for the last sibling folder.</summary>
|
||||
[Fact]
|
||||
public void FolderContextMenu_MoveDown_IsDisabled_OnLastSibling()
|
||||
{
|
||||
@@ -357,6 +368,7 @@ public class TemplatesPageTests : BunitContext
|
||||
Assert.True(moveDownBtn.HasAttribute("disabled"), "Move down should be disabled for the last sibling");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the root context menu offers new folder and new template.</summary>
|
||||
[Fact]
|
||||
public void RootContextMenu_OffersNewFolderAndNewTemplate()
|
||||
{
|
||||
@@ -376,6 +388,7 @@ public class TemplatesPageTests : BunitContext
|
||||
Assert.Contains("New Template", labels);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that choosing new template from the root menu navigates to the root create page.</summary>
|
||||
[Fact]
|
||||
public void RootContextMenu_NewTemplate_NavigatesToRootCreate()
|
||||
{
|
||||
@@ -420,6 +433,7 @@ public class TemplatesPageTests : BunitContext
|
||||
return cut.Find(".dropdown-menu.show");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the template context menu offers a new instance item to a deployer.</summary>
|
||||
[Fact]
|
||||
public void TemplateContextMenu_OffersNewInstance_ForDeployer()
|
||||
{
|
||||
@@ -438,6 +452,7 @@ public class TemplatesPageTests : BunitContext
|
||||
Assert.EndsWith("/deployment/instances/create?templateId=42", nav.Uri);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the template context menu hides the new instance item from a designer-only user.</summary>
|
||||
[Fact]
|
||||
public void TemplateContextMenu_HidesNewInstance_ForDesignerOnly()
|
||||
{
|
||||
@@ -454,7 +469,10 @@ public class TemplatesPageTests : BunitContext
|
||||
internal sealed class TestAuthStateProvider : AuthenticationStateProvider
|
||||
{
|
||||
private readonly ClaimsPrincipal _user;
|
||||
/// <summary>Creates a provider that always returns the given user.</summary>
|
||||
/// <param name="user">The claims principal to authenticate as.</param>
|
||||
public TestAuthStateProvider(ClaimsPrincipal user) => _user = user;
|
||||
/// <inheritdoc />
|
||||
public override Task<AuthenticationState> GetAuthenticationStateAsync()
|
||||
=> Task.FromResult(new AuthenticationState(_user));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user