-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
There's no way to mock different app states. ProcessInfo.processInfo.arguments.contains("mockRequests") is checking only for real implementation or successful mock which just lets us test the "correct path". It would be really helpful to have a way to inject or set up an object with the desired functionality to generate the expected state.
This approach seems to fit nicely with the current setup and architecture: How to control the world
it would provide us with the ability to write tests in this manner:
func testInterestAreNotShownIfTheresNoiCloud() {
Current.interestService = { NoiCloudInterestService() }
object.fetchInterests() // view model or controller
XCTAssertTrue(object.showsiCloudNotConnectedMessage)
}