Roman Elizarov
1 min readMar 29, 2019

--

I do not see much reason to mock extension functions. IMHO, you should be mocking the core entity you are testing against and extension functions are just utilities. The code under test does not even have to use extension function since, by definition, it can acquire all the needed state of an object and interact with it using its member methods and properties.

--

--

Roman Elizarov

Project Lead for the Kotlin Programming Language @JetBrains