diff --git a/src/functions/assert/Equivalence/Should-BeEquivalent.ps1 b/src/functions/assert/Equivalence/Should-BeEquivalent.ps1 index fe2b099da..5c46b08b0 100644 --- a/src/functions/assert/Equivalence/Should-BeEquivalent.ps1 +++ b/src/functions/assert/Equivalence/Should-BeEquivalent.ps1 @@ -639,43 +639,45 @@ function Should-BeEquivalent { .EXAMPLE ```powershell - Should-BeEquivalent ... -ExcludePath 'Id', 'Timestamp' -Comparator 'Equality' + Should-BeEquivalent ... -ExcludePath 'Id', 'Timestamp' -Comparator 'Equality' ``` + This example generates an equivalency option object that excludes the 'Id' and 'Timestamp' properties from the comparison and uses a simple equality comparison strategy. .EXAMPLE ```powereshell - Should-BeEquivalent ... -ExcludePathsNotOnExpected + Should-BeEquivalent ... -ExcludePathsNotOnExpected ``` + This example generates an equivalency option object that excludes any paths not present on the expected object from the comparison, using the default deep comparison strategy. .EXAMPLE ```powershell - $expected = [PSCustomObject] @{ - Name = "Thomas" - } + $expected = [PSCustomObject] @{ + Name = "Thomas" + } - $actual = [PSCustomObject] @{ - Name = "Jakub" - Age = 30 - } + $actual = [PSCustomObject] @{ + Name = "Jakub" + Age = 30 + } - $actual | Should-BeEquivalent $expected + $actual | Should-BeEquivalent $expected ``` This will throw an error because the actual object has an additional property Age and the Name values are not equivalent. .EXAMPLE ```powershell - $expected = [PSCustomObject] @{ - Name = "Thomas" - } + $expected = [PSCustomObject] @{ + Name = "Thomas" + } - $actual = [PSCustomObject] @{ - Name = "Thomas" - } + $actual = [PSCustomObject] @{ + Name = "Thomas" + } - $actual | Should-BeEquivalent $expected + $actual | Should-BeEquivalent $expected ``` This will pass because the actual object has the same properties as the expected object and the Name values are equivalent. @@ -737,10 +739,12 @@ function Get-EquivalencyOption { .EXAMPLE $option = Get-EquivalencyOption -ExcludePath 'Id', 'Timestamp' -Comparator 'Equality' + This example generates an equivalency option object that excludes the 'Id' and 'Timestamp' properties from the comparison and uses a simple equality comparison strategy. .EXAMPLE $option = Get-EquivalencyOption -ExcludePathsNotOnExpected + This example generates an equivalency option object that excludes any paths not present on the expected object from the comparison, using the default deep comparison strategy. .LINK diff --git a/src/functions/assert/General/Should-NotBeSame.ps1 b/src/functions/assert/General/Should-NotBeSame.ps1 index e27517e9f..52be7f9be 100644 --- a/src/functions/assert/General/Should-NotBeSame.ps1 +++ b/src/functions/assert/General/Should-NotBeSame.ps1 @@ -17,6 +17,7 @@ $object = New-Object -TypeName PSObject $object | Should-NotBeSame $object ``` + This assertion will pass, because the actual value is not the same instance as the expected value. .EXAMPLE diff --git a/src/functions/assert/String/Should-BeLikeString.ps1 b/src/functions/assert/String/Should-BeLikeString.ps1 index c6a32a3fd..ec3677c88 100644 --- a/src/functions/assert/String/Should-BeLikeString.ps1 +++ b/src/functions/assert/String/Should-BeLikeString.ps1 @@ -42,7 +42,6 @@ function Should-BeLikeString { .EXAMPLE ```powershell - "hello" | Should-BeLikeString "H*" -CaseSensitive ``` diff --git a/src/functions/assert/String/Should-NotBeEmptyString.ps1 b/src/functions/assert/String/Should-NotBeEmptyString.ps1 index 2c5c3b909..4b70bee7d 100644 --- a/src/functions/assert/String/Should-NotBeEmptyString.ps1 +++ b/src/functions/assert/String/Should-NotBeEmptyString.ps1 @@ -26,7 +26,7 @@ This test will fail, the input is an empty string. .EXAMPLE - ``` + ```powershell $null | Should-NotBeEmptyString $() | Should-NotBeEmptyString $false | Should-NotBeEmptyString diff --git a/src/functions/assert/String/Should-NotBeString.ps1 b/src/functions/assert/String/Should-NotBeString.ps1 index 25917041c..051e4fc46 100644 --- a/src/functions/assert/String/Should-NotBeString.ps1 +++ b/src/functions/assert/String/Should-NotBeString.ps1 @@ -29,12 +29,14 @@ function Should-NotBeString { ```powershell "hello" | Should-NotBeString "HELLO" ``` + This assertion will pass, because the actual value is not equal to the expected value. .EXAMPLE ```powershell "hello" | Should-NotBeString "hello" -CaseSensitive ``` + This assertion will fail, because the actual value is equal to the expected value. .NOTES diff --git a/src/functions/assert/Time/Should-BeAfter.ps1 b/src/functions/assert/Time/Should-BeAfter.ps1 index 0d68b1e1d..742383b33 100644 --- a/src/functions/assert/Time/Should-BeAfter.ps1 +++ b/src/functions/assert/Time/Should-BeAfter.ps1 @@ -29,7 +29,6 @@ (Get-Date).AddDays(1) | Should-BeAfter (Get-Date) ``` - This assertion will pass, because the actual value is after the expected value. .EXAMPLE diff --git a/src/functions/assert/Time/Should-BeBefore.ps1 b/src/functions/assert/Time/Should-BeBefore.ps1 index b27ecf3dd..2ee9a3d17 100644 --- a/src/functions/assert/Time/Should-BeBefore.ps1 +++ b/src/functions/assert/Time/Should-BeBefore.ps1 @@ -35,6 +35,7 @@ ```powershell (Get-Date).AddDays(1) | Should-BeBefore (Get-Date) ``` + This assertion will fail, because the actual value is not before the expected value. .EXAMPLE @@ -46,7 +47,6 @@ .EXAMPLE ```powershell - (Get-Date).AddDays(-2) | Should-BeBefore -Time 3days -Ago ``` diff --git a/src/functions/assert/Time/Should-BeFasterThan.ps1 b/src/functions/assert/Time/Should-BeFasterThan.ps1 index c97b4559b..3dafd3ed5 100644 --- a/src/functions/assert/Time/Should-BeFasterThan.ps1 +++ b/src/functions/assert/Time/Should-BeFasterThan.ps1 @@ -21,7 +21,7 @@ .EXAMPLE ```powershell - { Start-Sleep -Milliseconds 100 } | Should-BeFasterThan 50ms + { Start-Sleep -Milliseconds 100 } | Should-BeFasterThan 50ms ``` This assertion will fail, because the actual value is not faster than the expected value. diff --git a/src/functions/assert/Time/Should-BeSlowerThan.ps1 b/src/functions/assert/Time/Should-BeSlowerThan.ps1 index fe86b82f2..42d7ada02 100644 --- a/src/functions/assert/Time/Should-BeSlowerThan.ps1 +++ b/src/functions/assert/Time/Should-BeSlowerThan.ps1 @@ -28,7 +28,6 @@ .EXAMPLE ```powershell - { Start-Sleep -Seconds 1 } | Should-BeSlowerThan 10seconds ```