Skip to content

Commit

Permalink
Added Version file and updated unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolas committed Jan 3, 2020
1 parent ca8ea5e commit 917ad1e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Test/TestPlugNpshell.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ Describe 'CheckMetricException'{
}
Describe 'CheckExceptions'{
It 'should match the exception Assumed OK'{
$out = { throw [AssumedOK]"Error"} | Should -Throw -PassThru
$out.Exception | Should -Match "AssumedOK"
$out = { throw [AssumedOK]::new('Error')} | Should -Throw -PassThru
$out.Exception.ErrorMessage | Should -Be "Error"
}

It 'should match the exception ResultError'{
$out = { throw [ResultError]"Error"} | Should -Throw -PassThru
$out = { throw [ResultError]::New("Error") } | Should -Throw -PassThru
$out.Exception | Should -Match "ResultError"
}
}
Expand Down Expand Up @@ -403,6 +403,18 @@ Describe 'Check Static methods'{
}
}

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

}
}




Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.1.1

0 comments on commit 917ad1e

Please sign in to comment.