mockk
mockk copied to clipboard
Feature: Add a way to verify constructor is called with defined values
Prerequisites
Please answer the following questions for yourself before submitting an issue.
- [x] I am running the latest version
- [x] I checked the documentation and found no answer
- [x] I checked to make sure that this issue has not already been filed
Expected Behavior
We can mock constructor and verify if a method was called on that mock class, here But there is no way to verify if a Constructor was called with defined parameter
class MockCls(private val a: Int = 0) {}
mockkConstructor(MockCls::class)
verifyNew(constructedWith<MockCls>("2"))
This issue is different from 209
did it solved?
That one would be nice!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you are sure that this issue is important and should not be marked as stale just ask to put an important label.
Hi, I would also like this feature to be included in the library.
This issue should have important label
This issue should have
importantlabel
Agreed, something like mockito's mockConstruction would be great. There are many cases where we need to validate the arguments used to instantiate an object