mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.5 KiB
Swift
49 lines
1.5 KiB
Swift
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
import Foundation
|
|
import Combine
|
|
import SessionUtilitiesKit
|
|
|
|
@testable import SessionMessagingKit
|
|
|
|
class MockOGMCache: Mock<OGMCacheType>, OGMCacheType {
|
|
var defaultRoomsPublisher: AnyPublisher<[OpenGroupAPI.Room], Error>? {
|
|
get { return accept() as? AnyPublisher<[OpenGroupAPI.Room], Error> }
|
|
set { accept(args: [newValue]) }
|
|
}
|
|
|
|
var groupImagePublishers: [String: AnyPublisher<Data, Error>] {
|
|
get { return accept() as! [String: AnyPublisher<Data, Error>] }
|
|
set { accept(args: [newValue]) }
|
|
}
|
|
|
|
var pollers: [String: OpenGroupAPI.Poller] {
|
|
get { return accept() as! [String: OpenGroupAPI.Poller] }
|
|
set { accept(args: [newValue]) }
|
|
}
|
|
|
|
var isPolling: Bool {
|
|
get { return accept() as! Bool }
|
|
set { accept(args: [newValue]) }
|
|
}
|
|
|
|
var hasPerformedInitialPoll: [String: Bool] {
|
|
get { return accept() as! [String: Bool] }
|
|
set { accept(args: [newValue]) }
|
|
}
|
|
|
|
var timeSinceLastPoll: [String: TimeInterval] {
|
|
get { return accept() as! [String: TimeInterval] }
|
|
set { accept(args: [newValue]) }
|
|
}
|
|
|
|
var pendingChanges: [OpenGroupAPI.PendingChange] {
|
|
get { return accept() as! [OpenGroupAPI.PendingChange] }
|
|
set { accept(args: [newValue]) }
|
|
}
|
|
|
|
func getTimeSinceLastOpen(using dependencies: Dependencies) -> TimeInterval {
|
|
return accept(args: [dependencies]) as! TimeInterval
|
|
}
|
|
}
|