Skip to content

Commit 14ed9f5

Browse files
committed
[ArrayList]::new() without a using namespace System.Collections
1 parent 973d2e7 commit 14ed9f5

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Tests/Rules/AvoidUsingArrayList.tests.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,14 @@ Describe "AvoidArrayList" {
197197
$violations | Should -BeNullOrEmpty
198198
}
199199

200+
It "new()" {
201+
$scriptDefinition = {
202+
$List = [ArrayList]::new()
203+
}.ToString()
204+
$violations = Invoke-ScriptAnalyzer -ScriptDefinition $scriptDefinition -Settings $Settings
205+
$violations | Should -BeNullOrEmpty
206+
}
207+
200208
It "Out of the namespace scope" {
201209
$scriptDefinition = $usingGeneric + {
202210
$List = New-Object ArrayList

0 commit comments

Comments
 (0)