Asserts that two objects aren't equal.
Assert-NotEqual [[-Expected] <Object>] [[-Actual] <Object>] [[-Message] <Object>] [<CommonParameters>]
Uses PowerShell's -eq
operator to determine if the two objects are equal or not.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Expected | Object | The expected value. |
false | false | |
Actual | Object | The actual value. |
false | false | |
Message | Object | A descriptive error about why the assertion might fail. |
false | false |
Assert-NotEqual 'Foo' 'Foo'
Demonstrates how to assert that 'Foo' -eq 'Foo'
, which they are.
Assert-NotEqual 'Foo' 'Bar' 'Didn''t get ''Bar'' result.'
Demonstrates how to show a reason why a test might have failed.