Browse Source

test: declare the plural helper names of the rule tests

PSScriptAnalyzer flagged the plural nouns and the state-changing verb of three helpers; the repository suppresses that rule for test helpers with a justification.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: AI Assistant <ai@example.com>
pull/118/head
Raimund Andree 2 days ago
parent
commit
51412e0af8
  1. 11
      Tests/ObjectApis.Tests.ps1

11
Tests/ObjectApis.Tests.ps1

@ -336,6 +336,9 @@ Describe 'Access rule helpers that take a path' {
$users = [Security2.IdentityReference2] 'S-1-5-32-545'
function Get-ExplicitEntries {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSUseSingularNouns', '', Justification = 'The helper returns the explicit entries of an item.'
)]
param ([string] $Path, [string] $Account = 'S-1-1-0')
$acl = Get-Acl -LiteralPath $Path
@ -344,6 +347,11 @@ Describe 'Access rule helpers that take a path' {
}
function New-AccountList {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSUseShouldProcessForStateChangingFunctions', '', Justification = 'Test helper that only creates a list.'
)]
param ()
$accounts = New-Object -TypeName 'System.Collections.Generic.List[Security2.IdentityReference2]'
$accounts.Add($identity)
$accounts.Add($users)
@ -479,6 +487,9 @@ Describe 'Audit rule helpers that take a path' -Skip:(-not $holdsSecurityPrivile
$users = [Security2.IdentityReference2] 'S-1-5-32-545'
function Get-AuditEntries {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSUseSingularNouns', '', Justification = 'The helper returns the audit entries of an item.'
)]
param ([string] $Path, [string] $Account = 'S-1-1-0')
$descriptor = Get-NTFSSecurityDescriptor -Path $Path

Loading…
Cancel
Save