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

Remove MockDependencyProvider #3456

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

samsymons
Copy link
Contributor

Task/Issue URL: https://app.asana.com/0/414235014887631/1208580381705388/f
Tech Design URL:
CC:

Description:

This PR removes MockDependencyProvider and the ability to create testing instances of AppDependencyProvider. Any test files that use it have been updated to take their dependencies directly.

The only tests affected by this change are subscription ones; DownloadManagerTests had a mock dependency provider property, but it didn't appear to be used in any way.

Steps to test this PR:

  1. Check that CI is green and that the changes in the diff look sensible

Definition of Done (Internal Only):

Device Testing:

  • iPhone SE (1st Gen)
  • iPhone 8
  • iPhone X
  • iPhone 14 Pro
  • iPad

OS Testing:

  • iOS 15
  • iOS 16
  • iOS 17

Theme Testing:

  • Light theme
  • Dark theme

Internal references:

Software Engineering Expectations
Technical Design Template

Comment on lines +28 to +40
let subscriptionManager: SubscriptionManager = {
let accountManager = AccountManagerMock()
let subscriptionService = DefaultSubscriptionEndpointService(currentServiceEnvironment: .production)
let authService = DefaultAuthEndpointService(currentServiceEnvironment: .production)
let storePurchaseManager = DefaultStorePurchaseManager()
return SubscriptionManagerMock(accountManager: accountManager,
subscriptionEndpointService: subscriptionService,
authEndpointService: authService,
storePurchaseManager: storePurchaseManager,
currentEnvironment: SubscriptionEnvironment(serviceEnvironment: .production,
purchasePlatform: .appStore),
canPurchase: true)
}()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could probably be done via some function to allow configuring the mocks, but since nothing needs that for now I haven't done it. Let me know if you'd prefer some other approach.

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.

1 participant