Created
August 6, 2021 09:09
-
-
Save frootloops/8f0f4afdf0a4a19a6d0dd1d96b6e5ccb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// preparation | |
var priceAlertApiService = PriceAlertApiServiceMock() | |
var priceAlertStorageService = PriceAlertStorageServiceMock() | |
let repository = PriceAlertRepository( | |
network: priceAlertApiService, | |
storage: priceAlertStorageService | |
) | |
// actual test | |
priceAlertStorageService.cachedPriceAlertsMockFunc.returns( | |
[.sample(id: "1"), .sample(id: "2")] | |
) | |
let result = repository.cachedPriceAlerts(symbol: "AAPL") | |
expect(result.map { $0.id }) == ["1", "2"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment