Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Adapty a singleton #42

Closed
layerzzzio opened this issue Feb 28, 2022 · 1 comment
Closed

Make Adapty a singleton #42

layerzzzio opened this issue Feb 28, 2022 · 1 comment

Comments

@layerzzzio
Copy link

layerzzzio commented Feb 28, 2022

Adapty is currently only like a namespace for several functions and has several static functions.
As the functions are static it makes it hard to mock Adapty to write tests.

Would be better to adopt something like:
https://github.com/FirebaseExtended/flutterfire/blob/master/packages/cloud_firestore/cloud_firestore/lib/src/firestore.dart

This would allow to mock and verify calls to Adapty, like:

verify(mockAdapty.whateverFunction();
verifyNoMoreInteractions(mockAdapty.whateverFunction);

@x401om
Copy link
Collaborator

x401om commented Jul 18, 2022

Hi, @layerzzzio! Thanks for the idea, it seems pretty reasonable and interesting. At the moment, the public interface of the Flutter SDK is completely the same on iOS and Android, but there will probably be significant changes on both in the near future. We will try to design the interface in a way that satisfies your request and solves the issue of automatic testing :)

@x401om x401om closed this as completed Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants