File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -62,12 +62,12 @@ Describe 'CheckMetricException'{
6262}
6363Describe ' 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
Original file line number Diff line number Diff line change 1+ 1.1.1
You can’t perform that action at this time.
0 commit comments