Skip to main content
Version: v5

Assert-MockCalled

SYNOPSIS#

Checks if a Mocked command has been called a certain number of times and throws an exception if it has not.

THIS COMMAND IS OBSOLETE AND WILL BE REMOVED SOMEWHERE DURING v5 LIFETIME, USE Should -Invoke INSTEAD.

SYNTAX#

ParameterFilter (Default)#

Assert-MockCalled [-CommandName] <String> [[-Times] <Int32>] [-ParameterFilter <ScriptBlock>] [-ModuleName <String>] [-Scope <String>] [-Exactly] [<CommonParameters>]

ExclusiveFilter#

Assert-MockCalled [-CommandName] <String> [[-Times] <Int32>] [-ParameterFilter <ScriptBlock>] -ExclusiveFilter <ScriptBlock> [-ModuleName <String>] [-Scope <String>] [-Exactly] [<CommonParameters>]

DESCRIPTION#

{{ Fill in the Description }}

EXAMPLES#

Example 1#

PS C:\> {{ Add example code here }}

{{ Add example description here }}

PARAMETERS#

-CommandName#

{{ Fill CommandName Description }}

Type: StringParameter Sets: (All)Aliases:
Required: TruePosition: 1Default value: NoneAccept pipeline input: FalseAccept wildcard characters: False

-Times#

{{ Fill Times Description }}

Type: Int32Parameter Sets: (All)Aliases:
Required: FalsePosition: 2Default value: 1Accept pipeline input: FalseAccept wildcard characters: False

-ParameterFilter#

{{ Fill ParameterFilter Description }}

Type: ScriptBlockParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: {$True}Accept pipeline input: FalseAccept wildcard characters: False

-ExclusiveFilter#

{{ Fill ExclusiveFilter Description }}

Type: ScriptBlockParameter Sets: ExclusiveFilterAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False

-ModuleName#

{{ Fill ModuleName Description }}

Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False

-Scope#

{{ Fill Scope Description }}

Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: 0Accept pipeline input: FalseAccept wildcard characters: False

-Exactly#

{{ Fill Exactly Description }}

Type: SwitchParameterParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: FalseAccept pipeline input: FalseAccept wildcard characters: False

CommonParameters#

This 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 LINKS#

https://pester.dev/docs/commands/Assert-MockCalled

EDIT THIS PAGE#

This page was auto-generated using the comment based help in Pester 5.2.1. To edit the content of this page, change the corresponding help in the pester/Pester repository. See our contribution guide for more information.