Skip to content

Commit 8e0bdfa

Browse files
author
Kapil Borle
committed
Fix CorrectionExtent instance creation in engine tests
1 parent 3212a20 commit 8e0bdfa

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Tests/Engine/CorrectionExtent.tests.ps1

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Describe "Correction Extent" {
88

99
Context "Object construction" {
1010
It "creates the object with correct properties" {
11-
$correctionExtent = $type::new(1, 1, 1, 3, "get-childitem", "newfile", "cool description")
11+
$correctionExtent = $obj = New-Object -TypeName $type -ArgumentList 1, 1, 1, 3, "get-childitem", "newfile", "cool description"
1212

1313
$correctionExtent.StartLineNumber | Should Be 1
1414
$correctionExtent.EndLineNumber | Should Be 1
@@ -18,17 +18,15 @@ Describe "Correction Extent" {
1818
$correctionExtent.File | Should Be "newfile"
1919
$correctionExtent.Description | Should Be "cool description"
2020
}
21-
21+
2222
It "throws if end line number is less than start line number" {
23-
$text = "Get-ChildItem"
24-
{$type::new(2, 1, 1, $text.Length + 1, $text, "newfile")} | Should Throw "start line number"
23+
$text = "Get-ChildItem"
24+
{New-Object -TypeName $type -ArgumentList @(2, 1, 1, $text.Length + 1, $text, "newfile")} | Should Throw "start line number"
2525
}
26-
26+
2727
It "throws if end column number is less than start column number for same line" {
2828
$text = "start-process"
29-
{$type::new(1, 1, 2, 1, $text, "newfile")} | Should Throw "start column number"
29+
{New-Object -TypeName $type -ArgumentList @(1, 1, 2, 1, $text, "newfile")} | Should Throw "start column number"
3030
}
3131
}
32-
}
33-
34-
32+
}

0 commit comments

Comments
 (0)