-
-
Notifications
You must be signed in to change notification settings - Fork 333
/
TestTransport.swift
35 lines (27 loc) · 1.28 KB
/
TestTransport.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import _SentryPrivate
import Foundation
public class TestTransport: NSObject, Transport {
public var sentEnvelopes = Invocations<SentryEnvelope>()
public func send(envelope: SentryEnvelope) {
sentEnvelopes.record(envelope)
}
public var storedEnvelopes = Invocations<SentryEnvelope>()
public func store(_ envelope: SentryEnvelope) {
storedEnvelopes.record(envelope)
}
public var recordLostEvents = Invocations<(category: SentryDataCategory, reason: SentryDiscardReason)>()
public func recordLostEvent(_ category: SentryDataCategory, reason: SentryDiscardReason) {
recordLostEvents.record((category, reason))
}
public var recordLostEventsWithCount = Invocations<(category: SentryDataCategory, reason: SentryDiscardReason, quantity: UInt)>()
public func recordLostEvent(_ category: SentryDataCategory, reason: SentryDiscardReason, quantity: UInt) {
recordLostEventsWithCount.record((category, reason, quantity))
}
public var flushInvocations = Invocations<TimeInterval>()
public func flush(_ timeout: TimeInterval) -> SentryFlushResult {
flushInvocations.record(timeout)
return .success
}
public func setStartFlushCallback(_ callback: @escaping () -> Void) {
}
}