mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Make AnalyticsService mockable via `AnalyticsServiceProtocol (#5599)
* Create AnalyticsServiceProtocol and conform AnalyticsService * Replace AnalyticsService properties and arguments with AnalyticsServiceProtocol * Inline AnalyticsServiceMock replacing old mock * handle more complex AnalyticsServiceMock callsites * move documentation from AnalyticsService to AnalyticsServiceProtocol
This commit is contained in:
@@ -13,7 +13,7 @@ import Testing
|
||||
|
||||
final class AnalyticsTests {
|
||||
private let appSettings: AppSettings
|
||||
private let analytics: AnalyticsService
|
||||
private let analytics: AnalyticsServiceProtocol
|
||||
private let analyticsClient: AnalyticsClientMock
|
||||
private var posthogMock: PHGPostHogMock
|
||||
|
||||
@@ -24,7 +24,7 @@ final class AnalyticsTests {
|
||||
|
||||
analyticsClient = AnalyticsClientMock()
|
||||
analyticsClient.isRunning = false
|
||||
analytics = .mock(analyticsClient, settings: appSettings)
|
||||
analytics = AnalyticsService(client: analyticsClient, appSettings: appSettings)
|
||||
|
||||
posthogMock = PHGPostHogMock()
|
||||
posthogMock.configureMockBehavior()
|
||||
|
||||
Reference in New Issue
Block a user