mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Added MediaProvider tests (#386)
* Media provider tests * Moved classes to separate files * Moved image file * Removed unused image file * Rebase and refactor. Replace removed error type. Refactor XYZMock to MockXYZ. Co-authored-by: Doug <douglase@element.io>
This commit is contained in:
committed by
GitHub
parent
e4d087a0a4
commit
e573bc0dd2
@@ -20,12 +20,12 @@ import UIKit
|
||||
struct MediaProvider: MediaProviderProtocol {
|
||||
private let mediaProxy: MediaProxyProtocol
|
||||
private let imageCache: Kingfisher.ImageCache
|
||||
private let fileCache: FileCache
|
||||
private let fileCache: FileCacheProtocol
|
||||
private let backgroundTaskService: BackgroundTaskServiceProtocol?
|
||||
|
||||
init(mediaProxy: MediaProxyProtocol,
|
||||
imageCache: Kingfisher.ImageCache,
|
||||
fileCache: FileCache,
|
||||
fileCache: FileCacheProtocol,
|
||||
backgroundTaskService: BackgroundTaskServiceProtocol?) {
|
||||
self.mediaProxy = mediaProxy
|
||||
self.imageCache = imageCache
|
||||
|
||||
@@ -54,7 +54,7 @@ class UserSessionStore: UserSessionStoreProtocol {
|
||||
return .success(UserSession(clientProxy: clientProxy,
|
||||
mediaProvider: MediaProvider(mediaProxy: clientProxy,
|
||||
imageCache: .onlyInMemory,
|
||||
fileCache: .default,
|
||||
fileCache: FileCache.default,
|
||||
backgroundTaskService: backgroundTaskService)))
|
||||
case .failure(let error):
|
||||
MXLog.error("Failed restoring login with error: \(error)")
|
||||
@@ -73,7 +73,7 @@ class UserSessionStore: UserSessionStoreProtocol {
|
||||
return .success(UserSession(clientProxy: clientProxy,
|
||||
mediaProvider: MediaProvider(mediaProxy: clientProxy,
|
||||
imageCache: .onlyInMemory,
|
||||
fileCache: .default,
|
||||
fileCache: FileCache.default,
|
||||
backgroundTaskService: backgroundTaskService)))
|
||||
case .failure(let error):
|
||||
MXLog.error("Failed creating user session with error: \(error)")
|
||||
|
||||
Reference in New Issue
Block a user