-
Notifications
You must be signed in to change notification settings - Fork 1
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
Ipc 186 unit tests payment component #395
Ipc 186 unit tests payment component #395
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! I think we need three more tests and then it's done.
...h-sdk/sdk/src/test/java/net/gini/android/health/sdk/paymentComponent/PaymentComponentTest.kt
Outdated
Show resolved
Hide resolved
...h-sdk/sdk/src/test/java/net/gini/android/health/sdk/paymentComponent/PaymentComponentTest.kt
Outdated
Show resolved
Hide resolved
...k/sdk/src/test/java/net/gini/android/health/sdk/paymentComponent/PaymentComponentViewTest.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! Thank you that you persevered and found such elegant solution to the context mocking problem! 👏
import androidx.annotation.VisibleForTesting | ||
import net.gini.android.health.sdk.paymentprovider.PaymentProviderApp | ||
|
||
// In a future refactoring we can split extensions into files according to what component they extend |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Comment] Yes, thank you for adding this comment! I wholeheartedly agree! 👍 👍 👍
mockkStatic(Context::generateBitmapDrawableIcon) | ||
mockkStatic(PackageManager::getPaymentProviderApps) | ||
every { privateContext.applicationContext } returns context | ||
every { privateContext.packageManager } returns packageManager | ||
every { privateContext.resources } returns resources | ||
every { privateContext.generateBitmapDrawableIcon(any(), any()) } returns null | ||
every { packageManager.getPaymentProviderApps(paymentProviderList, privateContext) } returns paymentProviderAppsList |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Comment] Thank you for this elegant solution! 👏
No description provided.