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

Ipc 186 unit tests payment component #395

Merged
merged 4 commits into from
Mar 21, 2024

Conversation

danicretu
Copy link
Contributor

No description provided.

Copy link
Contributor

@a-szotyori a-szotyori left a 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.

Copy link
Contributor

@a-szotyori a-szotyori left a 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
Copy link
Contributor

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! 👍 👍 👍

Comment on lines +122 to +128
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
Copy link
Contributor

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! 👏

@danicretu danicretu merged commit 5c83ff8 into ipc-health-sdk-update Mar 21, 2024
6 checks passed
@danicretu danicretu deleted the IPC-186-Unit-tests-payment-component branch March 21, 2024 12:18
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

Successfully merging this pull request may close these issues.

2 participants