다음을 통해 공유


MoreAsserts.CheckEqualsAndHashCodeMethods Method

Definition

Overloads

CheckEqualsAndHashCodeMethods(Object, Object, Boolean)

Variant of checkEqualsAndHashCodeMethods(String,Object,Object,boolean.

CheckEqualsAndHashCodeMethods(String, Object, Object, Boolean)

Utility for testing equals() and hashCode() results at once.

CheckEqualsAndHashCodeMethods(Object, Object, Boolean)

Variant of checkEqualsAndHashCodeMethods(String,Object,Object,boolean.

[Android.Runtime.Register("checkEqualsAndHashCodeMethods", "(Ljava/lang/Object;Ljava/lang/Object;Z)V", "")]
public static void CheckEqualsAndHashCodeMethods (Java.Lang.Object? lhs, Java.Lang.Object? rhs, bool expectedResult);
[<Android.Runtime.Register("checkEqualsAndHashCodeMethods", "(Ljava/lang/Object;Ljava/lang/Object;Z)V", "")>]
static member CheckEqualsAndHashCodeMethods : Java.Lang.Object * Java.Lang.Object * bool -> unit

Parameters

lhs
Object
rhs
Object
expectedResult
Boolean
Attributes

Remarks

Variant of checkEqualsAndHashCodeMethods(String,Object,Object,boolean...)} using a generic message.

Java documentation for android.test.MoreAsserts.checkEqualsAndHashCodeMethods(java.lang.Object, java.lang.Object, boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

CheckEqualsAndHashCodeMethods(String, Object, Object, Boolean)

Utility for testing equals() and hashCode() results at once.

[Android.Runtime.Register("checkEqualsAndHashCodeMethods", "(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Z)V", "")]
public static void CheckEqualsAndHashCodeMethods (string? message, Java.Lang.Object? lhs, Java.Lang.Object? rhs, bool expectedResult);
[<Android.Runtime.Register("checkEqualsAndHashCodeMethods", "(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Z)V", "")>]
static member CheckEqualsAndHashCodeMethods : string * Java.Lang.Object * Java.Lang.Object * bool -> unit

Parameters

message
String
lhs
Object

An Object for which equals() and hashCode() are to be tested.

rhs
Object

As lhs.

expectedResult
Boolean

True if the objects should compare equal, false if not.

Attributes

Remarks

Utility for testing equals() and hashCode() results at once. Tests that lhs.equals(rhs) matches expectedResult, as well as rhs.equals(lhs). Also tests that hashCode() return values are equal if expectedResult is true. (hashCode() is not tested if expectedResult is false, as unequal objects can have equal hashCodes.)

Java documentation for android.test.MoreAsserts.checkEqualsAndHashCodeMethods(java.lang.String, java.lang.Object, java.lang.Object, boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to