< Back
Assert-NotEqual
Post
NAME Assert-NotEqual
SYNOPSIS
Asserts that two objects aren't equal.
SYNTAX
Assert-NotEqual [[-Expected] <Object>] [[-Actual] <Object>] [[-Message] <Object>] [<CommonParameters>]
DESCRIPTION
Uses PowerShell's `-eq` operator to determine if the two objects are equal or not.
PARAMETERS
-Expected <Object>
The expected value.
Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Actual <Object>
The actual value.
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Message <Object>
A descriptive error about why the assertion might fail.
Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Assert-NotEqual 'Foo' 'Foo'
Demonstrates how to assert that `'Foo' -eq 'Foo'`, which they are.
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>Assert-NotEqual 'Foo' 'Bar' 'Didn''t get ''Bar'' result.'
Demonstrates how to show a reason why a test might have failed.
RELATED LINKS
Assert-Equal
Assert-CEqual
SYNOPSIS
Asserts that two objects aren't equal.
SYNTAX
Assert-NotEqual [[-Expected] <Object>] [[-Actual] <Object>] [[-Message] <Object>] [<CommonParameters>]
DESCRIPTION
Uses PowerShell's `-eq` operator to determine if the two objects are equal or not.
PARAMETERS
-Expected <Object>
The expected value.
Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Actual <Object>
The actual value.
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Message <Object>
A descriptive error about why the assertion might fail.
Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Assert-NotEqual 'Foo' 'Foo'
Demonstrates how to assert that `'Foo' -eq 'Foo'`, which they are.
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>Assert-NotEqual 'Foo' 'Bar' 'Didn''t get ''Bar'' result.'
Demonstrates how to show a reason why a test might have failed.
RELATED LINKS
Assert-Equal
Assert-CEqual