The new revenue cat v4 SDK for iOS is very difficult if not impossible to mock for unit testing purposes. Some of the contributing factors that make mocking difficult are:
- The majority of classes like Offerings, Offering, Package, etc are marked as final so they can’t be subclassed. So something like class MockOfferings: Offerings {} cannot be done.
- The majority of initializers for classes like Offerings, Offering, Package are internal so they cannot be called from outside the package
These issues are blocking upgrading to v4 since it breaks all the existing unit tests without a new way to fix them. Is there any sample code available that successfully mocks the RevenueCat SDK?