forked from getsentry/sentry-cocoa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestConstants.swift
28 lines (23 loc) · 941 Bytes
/
TestConstants.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
public struct TestConstants {
/**
* Real dsn for integration tests.
*/
public static let realDSN: String = "https://[email protected]/5428557"
public static func dsnAsString(username: String) -> String {
return "https://\(username):[email protected]/12345"
}
public static func dsn(username: String) throws -> SentryDsn {
return try SentryDsn(string: self.dsnAsString(username: username))
}
public static var eventWithSerializationError: Event {
let event = Event()
event.message = SentryMessage(formatted: "")
event.sdk = ["event": Event()]
return event
}
public static var envelope: SentryEnvelope {
let event = Event()
let envelopeItem = SentryEnvelopeItem(event: event)
return SentryEnvelope(id: event.eventId, singleItem: envelopeItem)
}
}