Skip to content

Commit

Permalink
Adds test for value by pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Hunt committed Dec 14, 2023
1 parent 2a448de commit 9239cf1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/httpunitps.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,25 @@ Describe 'Invoke-HttpUnit' {
$result.TimeTotal | Should -BeGreaterThan ([timespan]::new(1))
}
}
Context 'By Value by Pipeline' {
It 'Should return 200 for google' {
$inputObject = [PSCustomObject]@{
Url = 'https://www.google.com/'
Code = 200
}
$result = $inputObject | Invoke-HttpUnit

$result.Label | Should -Be "https://www.google.com/"
$result.Result | Should -BeNullOrEmpty
$result.Connected | Should -Be $True
$result.GotCode | Should -Be $True
$result.GotText | Should -Be $False
$result.GotRegex | Should -Be $False
$result.GotHeaders | Should -Be $False
$result.InvalidCert | Should -Be $False
$result.TimeTotal | Should -BeGreaterThan ([timespan]::new(1))
}
}
}

AfterAll {
Expand Down

0 comments on commit 9239cf1

Please sign in to comment.