File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
FirebaseSessions/Tests/Unit Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -94,4 +94,30 @@ class SessionCoordinatorTests: XCTestCase {
94
94
XCTAssertEqual ( fireLogger. loggedEvent, event)
95
95
XCTAssertFalse ( resultSuccess)
96
96
}
97
+
98
+ func test_attemptLoggingSessionStart_handlesInstallationsError( ) throws {
99
+ installations. result = . failure( NSError ( domain: " TestInstallationsError " , code: - 1 ) )
100
+
101
+ let sessionInfo = SessionInfo (
102
+ sessionId: " testSessionId " ,
103
+ previousSessionId: " testPreviousSessionId " ,
104
+ dispatchEvents: true
105
+ )
106
+ let event = SessionStartEvent ( sessionInfo: sessionInfo, appInfo: appInfo, time: time)
107
+
108
+ // Start success so it must be set to false
109
+ var resultSuccess = true
110
+ coordinator. attemptLoggingSessionStart ( event: event) { result in
111
+ switch result {
112
+ case . success( ( ) ) :
113
+ resultSuccess = true
114
+ case . failure:
115
+ resultSuccess = false
116
+ }
117
+ }
118
+
119
+ // We should have logged the event, but with a failed result
120
+ XCTAssertNil ( fireLogger. loggedEvent)
121
+ XCTAssertFalse ( resultSuccess)
122
+ }
97
123
}
You can’t perform that action at this time.
0 commit comments