Skip to content

Commit 917ad1e

Browse files
author
Nikolas
committed
Added Version file and updated unit tests
1 parent ca8ea5e commit 917ad1e

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

Test/TestPlugNpshell.Tests.ps1

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ Describe 'CheckMetricException'{
6262
}
6363
Describe 'CheckExceptions'{
6464
It 'should match the exception Assumed OK'{
65-
$out = { throw [AssumedOK]"Error"} | Should -Throw -PassThru
66-
$out.Exception | Should -Match "AssumedOK"
65+
$out = { throw [AssumedOK]::new('Error')} | Should -Throw -PassThru
66+
$out.Exception.ErrorMessage | Should -Be "Error"
6767
}
6868

6969
It 'should match the exception ResultError'{
70-
$out = { throw [ResultError]"Error"} | Should -Throw -PassThru
70+
$out = { throw [ResultError]::New("Error") } | Should -Throw -PassThru
7171
$out.Exception | Should -Match "ResultError"
7272
}
7373
}
@@ -403,6 +403,18 @@ Describe 'Check Static methods'{
403403
}
404404
}
405405

406+
Describe 'Check /s handling'{
407+
$Check = [Check]@{Name = "Check"; Sep =" ++ "}
408+
$MetricA = [Metric]::New(@{Name = "outbound_obj"; Value = 2; UOM = 'per_second'; WarningThreshold = '50'; CriticalThreshold = '60';
409+
DisplayName = "Outbound Objects";})
410+
It 'Should the expected output for per_second'{
411+
$Check.addMetricObj(@($metricA,$metricB))
412+
$Expected = "METRIC OK - Outbound Objects is 2/s | outbound_obj=2per_second;50;60 "
413+
(Get-Final($check) | Should -Be $Expected)
414+
415+
}
416+
}
417+
406418

407419

408420

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.1.1

0 commit comments

Comments
 (0)