Skip to content

Commit

Permalink
Update SentryScopeSwiftTests.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
brustolin committed Aug 14, 2023
1 parent f93cd30 commit 703848f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Tests/SentryTests/SentryScopeSwiftTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ class SentryScopeSwiftTests: XCTestCase {

func testApplyToEvent() {
let actual = fixture.scope.applyTo(event: fixture.event, maxBreadcrumbs: 10)

let actualContext = actual?.context as? [String: [String: String]]

XCTAssertEqual(fixture.tags, actual?.tags)
XCTAssertEqual(fixture.extra, actual?.extra as? [String: String])
XCTAssertEqual(fixture.user, actual?.user)
Expand All @@ -159,7 +160,8 @@ class SentryScopeSwiftTests: XCTestCase {
XCTAssertEqual(fixture.fingerprint, actual?.fingerprint)
XCTAssertEqual(fixture.level, actual?.level)
XCTAssertEqual([fixture.breadcrumb], actual?.breadcrumbs)
XCTAssertEqual(fixture.context, actual?.context as? [String: [String: String]])
XCTAssertEqual(fixture.context["c"], actualContext?["c"])
XCTAssertNotNil(actualContext?["trace"])
}

func testApplyToEvent_EventWithTags() {
Expand Down Expand Up @@ -267,7 +269,8 @@ class SentryScopeSwiftTests: XCTestCase {
}

func testApplyToEvent_EventWithContext() {
let context = NSMutableDictionary(dictionary: ["my": ["extra": "context"]])
let context = NSMutableDictionary(dictionary: ["my": ["extra": "context"],
"trace": fixture.scope.propagationContext.traceForEvent() ])
let event = fixture.event
event.context = context as? [String: [String: String]]

Expand All @@ -289,7 +292,7 @@ class SentryScopeSwiftTests: XCTestCase {

func testApplyToEvent_EventWithContext_MergesContext() {
let context = NSMutableDictionary(dictionary: [
"first": ["a": "b", "c": "d"]])
"first": ["a": "b", "c": "d"], "trace": fixture.scope.propagationContext.traceForEvent()])
let event = fixture.event
event.context = context as? [String: [String: String]]

Expand Down

0 comments on commit 703848f

Please sign in to comment.