# mockk

Mikhail Fedotov

05/31/2023, 10:49 AM
Hello! Is it a good or bad idea to try implement equals/hashCode methods on mock instance? In a test I need to compare the result of factory function with an expected value, and this result contains some data that must be mocked (Android Spannable class). So to compare data containing mocks I need those mock instance to be comparable to each other. In this scenario mocks works like fakes actually.
🚫 1
I have checked technically it works and may be implemented. All calles on mocks are serialized (collected) to string and mocks are compared by this strings..