Skip to content
Snippets Groups Projects
Select Git revision
  • dev protected
  • hotfixes-oct-2022
  • main default protected
  • refactor/avatar-cell
  • 1.1.5
  • 1.1.4
  • 1.1.3
  • 1.1
  • 1.0.8
  • 1.0.7
  • 1.0.6
11 results

SideMenuDismissInteractor.swift

Blame
  • TestDoubles.swift NaN GiB
    import XXClient
    import XXMessengerClient
    
    extension Message {
      static func stub(_ stubId: Int) -> Message {
        .init(
          messageType: stubId,
          id: "id-\(stubId)".data(using: .utf8)!,
          payload: "payload-\(stubId)".data(using: .utf8)!,
          sender: "sender-\(stubId)".data(using: .utf8)!,
          recipientId: "recipientId-\(stubId)".data(using: .utf8)!,
          ephemeralId: stubId,
          timestamp: stubId,
          encrypted: stubId % 2 == 0,
          roundId: stubId,
          roundURL: "roundURL-\(stubId)"
        )
      }
    }
    
    extension ReceivedFile {
      static func stub(_ id: Int) -> ReceivedFile {
        ReceivedFile(
          transferId: "transfer-id-\(id)".data(using: .utf8)!,
          senderId: "sender-id-\(id)".data(using: .utf8)!,
          preview: "preview-\(id)".data(using: .utf8)!,
          name: "name-\(id)",
          type: "type-\(id)",
          size: id
        )
      }
    }
    
    extension MessageServiceList {
      static func stub() -> MessageServiceList {
        (1...3).map { .stub($0) }
      }
    }
    
    extension MessageServiceListElement {
      static func stub(_ id: Int) -> MessageServiceListElement {
        MessageServiceListElement(
          id: "id-\(id)".data(using: .utf8)!,
          services: (1...3).map { $0 + 10 * id }.map { .stub($0) }
        )
      }
    }
    
    extension MessageService {
      static func stub(_ id: Int) -> MessageService {
        MessageService(
          identifier: "identifier-\(id)".data(using: .utf8)!,
          tag: "tag-\(id)",
          metadata: "metadata-\(id)".data(using: .utf8)!
        )
      }
    }