useSpyOnEqualsIf

abstract fun useSpyOnEqualsIf(spyTarget: Any?, other: Any?, spyOn: (Any?) -> Boolean, mockKlass: KClass<out Any>)

Binds the given function, which should be equals, to the Proxy. The spy equals method will be used if the other object is not of the same type as the given Class of the hosting mock. The equals method will be used if the other object is of the same type as the given Class of the hosting mock.

Parameters

spyTarget

the referenced object which is spied upon.

other

the object to compare to if the hosting mock is used instead of the spy target.

spyOn

function which should reference the spy target equals method.

mockKlass

the KClass of the hosting mock.