Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
A basic inequality checking assertion... |
Syntax
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
notEqual( expected, actual, message ); |
Parameters
Parameter | Type | Mandatory | Notes | API Version |
---|---|---|---|---|
expected | Variant | The expected value. | 1.0 | |
actual | Variant | The actual value. | 1.0 | |
message | String | A message stating what the assertion is testing. | 1.0 |
Return Values
Value | Type | Notes | API Version |
---|---|---|---|
<error> | Error | Most likely the parameters are wrong. | 1.0 |
true | Boolean | expected != actual. | 1.0 |
false | Boolean | expected == actual. | 1.0 |
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
Test("Inequality checks", Test.ANY( ), function(_global, settings) { // assertions will fail notEqual( true, true, "true != true?" ); notEqual( undefined, null, "undefined != null?" ); notEqual( null, false, "null != false?" ); notEqual( "fish", true, "'fish' != true?" ); // assertion will pass notEqual( true, false, "true != false?" ); }); |
Div | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Availability
Requires:
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|
Div | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
Test APITopics:
|