mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Removing Dead Code part 1 (#2234)
This commit is contained in:
@@ -45,18 +45,6 @@ extension ApplicationMock {
|
||||
underlyingApplicationState = applicationState
|
||||
underlyingBackgroundTimeRemaining = backgroundTimeRemaining
|
||||
|
||||
beginBackgroundTaskExpirationHandlerClosure = { [weak self] handler in
|
||||
guard let self else {
|
||||
return .invalid
|
||||
}
|
||||
|
||||
guard allowTasks else {
|
||||
return .invalid
|
||||
}
|
||||
|
||||
return beginBackgroundTask(withName: nil, expirationHandler: handler)
|
||||
}
|
||||
|
||||
beginBackgroundTaskWithNameExpirationHandlerClosure = { _, handler in
|
||||
guard allowTasks else {
|
||||
return .invalid
|
||||
|
||||
@@ -56,18 +56,6 @@ class AnalyticsClientMock: AnalyticsClientProtocol {
|
||||
stopCallsCount += 1
|
||||
stopClosure?()
|
||||
}
|
||||
//MARK: - flush
|
||||
|
||||
var flushCallsCount = 0
|
||||
var flushCalled: Bool {
|
||||
return flushCallsCount > 0
|
||||
}
|
||||
var flushClosure: (() -> Void)?
|
||||
|
||||
func flush() {
|
||||
flushCallsCount += 1
|
||||
flushClosure?()
|
||||
}
|
||||
//MARK: - capture
|
||||
|
||||
var captureCallsCount = 0
|
||||
@@ -100,22 +88,6 @@ class AnalyticsClientMock: AnalyticsClientProtocol {
|
||||
screenReceivedInvocations.append(event)
|
||||
screenClosure?(event)
|
||||
}
|
||||
//MARK: - updateUserProperties
|
||||
|
||||
var updateUserPropertiesCallsCount = 0
|
||||
var updateUserPropertiesCalled: Bool {
|
||||
return updateUserPropertiesCallsCount > 0
|
||||
}
|
||||
var updateUserPropertiesReceivedUserProperties: AnalyticsEvent.UserProperties?
|
||||
var updateUserPropertiesReceivedInvocations: [AnalyticsEvent.UserProperties] = []
|
||||
var updateUserPropertiesClosure: ((AnalyticsEvent.UserProperties) -> Void)?
|
||||
|
||||
func updateUserProperties(_ userProperties: AnalyticsEvent.UserProperties) {
|
||||
updateUserPropertiesCallsCount += 1
|
||||
updateUserPropertiesReceivedUserProperties = userProperties
|
||||
updateUserPropertiesReceivedInvocations.append(userProperties)
|
||||
updateUserPropertiesClosure?(userProperties)
|
||||
}
|
||||
}
|
||||
class AppLockServiceMock: AppLockServiceProtocol {
|
||||
var isMandatory: Bool {
|
||||
@@ -323,23 +295,6 @@ class ApplicationMock: ApplicationProtocol {
|
||||
|
||||
//MARK: - beginBackgroundTask
|
||||
|
||||
var beginBackgroundTaskExpirationHandlerCallsCount = 0
|
||||
var beginBackgroundTaskExpirationHandlerCalled: Bool {
|
||||
return beginBackgroundTaskExpirationHandlerCallsCount > 0
|
||||
}
|
||||
var beginBackgroundTaskExpirationHandlerReturnValue: UIBackgroundTaskIdentifier!
|
||||
var beginBackgroundTaskExpirationHandlerClosure: (((() -> Void)?) -> UIBackgroundTaskIdentifier)?
|
||||
|
||||
func beginBackgroundTask(expirationHandler handler: (() -> Void)?) -> UIBackgroundTaskIdentifier {
|
||||
beginBackgroundTaskExpirationHandlerCallsCount += 1
|
||||
if let beginBackgroundTaskExpirationHandlerClosure = beginBackgroundTaskExpirationHandlerClosure {
|
||||
return beginBackgroundTaskExpirationHandlerClosure(handler)
|
||||
} else {
|
||||
return beginBackgroundTaskExpirationHandlerReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - beginBackgroundTask
|
||||
|
||||
var beginBackgroundTaskWithNameExpirationHandlerCallsCount = 0
|
||||
var beginBackgroundTaskWithNameExpirationHandlerCalled: Bool {
|
||||
return beginBackgroundTaskWithNameExpirationHandlerCallsCount > 0
|
||||
@@ -739,18 +694,6 @@ class BugReportServiceMock: BugReportServiceProtocol {
|
||||
resetCallsCount += 1
|
||||
resetClosure?()
|
||||
}
|
||||
//MARK: - crash
|
||||
|
||||
var crashCallsCount = 0
|
||||
var crashCalled: Bool {
|
||||
return crashCallsCount > 0
|
||||
}
|
||||
var crashClosure: (() -> Void)?
|
||||
|
||||
func crash() {
|
||||
crashCallsCount += 1
|
||||
crashClosure?()
|
||||
}
|
||||
//MARK: - submitBugReport
|
||||
|
||||
var submitBugReportProgressListenerCallsCount = 0
|
||||
|
||||
Reference in New Issue
Block a user