Should
#
SYNOPSISShould is a keyword that is used to define an assertion inside an It block.
#
SYNTAX#
Be#
BeExactly#
BeGreaterThan#
BeLessOrEqual#
BeIn#
BeLessThan#
BeGreaterOrEqual#
BeLike#
BeLikeExactly#
BeNullOrEmpty#
BeOfType#
BeTrue#
BeFalse#
Contain#
Exist#
FileContentMatch#
FileContentMatchExactly#
FileContentMatchMultiline#
HaveCount#
HaveParameter#
Match#
MatchExactly#
Throw#
InvokeVerifiable#
Invoke#
DESCRIPTIONShould is a keyword that is used to define an assertion inside an It block. Should provides assertion methods to verify assertions e.g. comparing objects. If assertion is not met the test fails and an exception is thrown.
Should can be used more than once in the It block if more than one assertion need to be verified. Each Should keyword needs to be on a separate line. Test will be passed only when all assertion will be met (logical conjuction).
#
EXAMPLES#
EXAMPLE 1#
EXAMPLE 2#
EXAMPLE 3#
EXAMPLE 4#
EXAMPLE 5#
EXAMPLE 6#
EXAMPLE 7#
EXAMPLE 8#
EXAMPLE 9#
PARAMETERS#
-ActualValueThe actual value that was obtained in the test which should be verified against a expected value.
#
-Alias{{ Fill Alias Description }}
#
-Be{{ Fill Be Description }}
#
-Because{{ Fill Because Description }}
#
-BeExactly{{ Fill BeExactly Description }}
#
-BeFalse{{ Fill BeFalse Description }}
#
-BeGreaterOrEqual{{ Fill BeGreaterOrEqual Description }}
#
-BeGreaterThan{{ Fill BeGreaterThan Description }}
#
-BeIn{{ Fill BeIn Description }}
#
-BeLessOrEqual{{ Fill BeLessOrEqual Description }}
#
-BeLessThan{{ Fill BeLessThan Description }}
#
-BeLike{{ Fill BeLike Description }}
#
-BeLikeExactly{{ Fill BeLikeExactly Description }}
#
-BeNullOrEmpty{{ Fill BeNullOrEmpty Description }}
#
-BeOfType{{ Fill BeOfType Description }}
#
-BeTrue{{ Fill BeTrue Description }}
#
-CallerSessionState{{ Fill CallerSessionState Description }}
#
-CommandName{{ Fill CommandName Description }}
#
-Contain{{ Fill Contain Description }}
#
-DefaultValue{{ Fill DefaultValue Description }}
#
-ErrorId{{ Fill ErrorId Description }}
#
-Exactly{{ Fill Exactly Description }}
#
-ExceptionType{{ Fill ExceptionType Description }}
#
-ExclusiveFilter{{ Fill ExclusiveFilter Description }}
#
-Exist{{ Fill Exist Description }}
#
-ExpectedContent{{ Fill ExpectedContent Description }}
#
-ExpectedMessage{{ Fill ExpectedMessage Description }}
#
-ExpectedType{{ Fill ExpectedType Description }}
#
-ExpectedValue{{ Fill ExpectedValue Description }}
#
-FileContentMatch{{ Fill FileContentMatch Description }}
#
-FileContentMatchExactly{{ Fill FileContentMatchExactly Description }}
#
-FileContentMatchMultiline{{ Fill FileContentMatchMultiline Description }}
#
-HasArgumentCompleter{{ Fill HasArgumentCompleter Description }}
#
-HaveCount{{ Fill HaveCount Description }}
#
-HaveParameter{{ Fill HaveParameter Description }}
#
-Invoke{{ Fill Invoke Description }}
#
-InvokeVerifiable{{ Fill InvokeVerifiable Description }}
#
-Mandatory{{ Fill Mandatory Description }}
#
-Match{{ Fill Match Description }}
#
-MatchExactly{{ Fill MatchExactly Description }}
#
-ModuleName{{ Fill ModuleName Description }}
#
-Not{{ Fill Not Description }}
#
-ParameterFilter{{ Fill ParameterFilter Description }}
#
-ParameterName{{ Fill ParameterName Description }}
#
-PassThru{{ Fill PassThru Description }}
#
-RegularExpression{{ Fill RegularExpression Description }}
#
-Scope{{ Fill Scope Description }}
#
-Throw{{ Fill Throw Description }}
#
-Times{{ Fill Times Description }}
#
-Type{{ Fill Type Description }}
#
CommonParametersThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
#
INPUTS#
OUTPUTS#
NOTES#
RELATED LINKShttps://pester.dev/docs/commands/Should
https://pester.dev/docs/usage/assertions
#
EDIT THIS PAGEThis page was auto-generated using the comment based help in Pester 5.1.1. To edit the content of this page, change the corresponding help in the pester/Pester repository. See our contribution guide for more information.