@@ -159,11 +159,11 @@ class SessionStartEventTests: XCTestCase {
159
159
( " something unknown " , firebase_appquality_sessions_OsName_UNKNOWN_OSNAME) ,
160
160
]
161
161
162
- expectations . forEach { ( given: String , expected: firebase_appquality_sessions_OsName ) in
162
+ for (given, expected) in expectations {
163
163
appInfo. osName = given
164
164
165
165
let event = SessionStartEvent (
166
- sessionInfo: self . defaultSessionInfo,
166
+ sessionInfo: defaultSessionInfo,
167
167
appInfo: appInfo,
168
168
time: time
169
169
)
@@ -188,17 +188,16 @@ class SessionStartEventTests: XCTestCase {
188
188
) ,
189
189
]
190
190
191
- expectations. forEach { ( given: DevEnvironment ,
192
- expected: firebase_appquality_sessions_LogEnvironment ) in
193
- appInfo. environment = given
191
+ for (given, expected) in expectations {
192
+ appInfo. environment = given
194
193
195
- let event = SessionStartEvent (
196
- sessionInfo: self . defaultSessionInfo,
197
- appInfo: appInfo,
198
- time: time
199
- )
194
+ let event = SessionStartEvent (
195
+ sessionInfo: defaultSessionInfo,
196
+ appInfo: appInfo,
197
+ time: time
198
+ )
200
199
201
- XCTAssertEqual ( event. proto. application_info. log_environment, expected)
200
+ XCTAssertEqual ( event. proto. application_info. log_environment, expected)
202
201
}
203
202
}
204
203
@@ -304,27 +303,26 @@ class SessionStartEventTests: XCTestCase {
304
303
) ,
305
304
]
306
305
307
- expectations. forEach { ( given: GULNetworkType ,
308
- expected: firebase_appquality_sessions_NetworkConnectionInfo_NetworkType ) in
309
- let mockNetworkInfo = MockNetworkInfo ( )
310
- mockNetworkInfo. networkType = given
311
- appInfo. networkInfo = mockNetworkInfo
306
+ for (given, expected) in expectations {
307
+ let mockNetworkInfo = MockNetworkInfo ( )
308
+ mockNetworkInfo. networkType = given
309
+ appInfo. networkInfo = mockNetworkInfo
312
310
313
- let event = SessionStartEvent (
314
- sessionInfo: self . defaultSessionInfo,
315
- appInfo: appInfo,
316
- time: time
317
- )
311
+ let event = SessionStartEvent (
312
+ sessionInfo: defaultSessionInfo,
313
+ appInfo: appInfo,
314
+ time: time
315
+ )
318
316
319
- // These fields will only be filled in when the Perf SDK is installed
320
- event. set ( subscriber: . Performance, isDataCollectionEnabled: true , appInfo: appInfo)
317
+ // These fields will only be filled in when the Perf SDK is installed
318
+ event. set ( subscriber: . Performance, isDataCollectionEnabled: true , appInfo: appInfo)
321
319
322
- testProtoAndDecodedProto ( sessionEvent: event) { proto in
323
- XCTAssertEqual (
324
- event. proto. application_info. apple_app_info. network_connection_info. network_type,
325
- expected
326
- )
327
- }
320
+ testProtoAndDecodedProto ( sessionEvent: event) { proto in
321
+ XCTAssertEqual (
322
+ event. proto. application_info. apple_app_info. network_connection_info. network_type,
323
+ expected
324
+ )
325
+ }
328
326
}
329
327
}
330
328
@@ -385,30 +383,28 @@ class SessionStartEventTests: XCTestCase {
385
383
) ,
386
384
]
387
385
388
- expectations
389
- . forEach { ( given: String ,
390
- expected: firebase_appquality_sessions_NetworkConnectionInfo_MobileSubtype ) in
391
- let mockNetworkInfo = MockNetworkInfo ( )
392
- mockNetworkInfo. mobileSubtype = given
393
- appInfo. networkInfo = mockNetworkInfo
394
-
395
- let event = SessionStartEvent (
396
- sessionInfo: self . defaultSessionInfo,
397
- appInfo: appInfo,
398
- time: time
399
- )
400
-
401
- // These fields will only be filled in when the Perf SDK is installed
402
- event. set ( subscriber: . Performance, isDataCollectionEnabled: true , appInfo: appInfo)
403
-
404
- testProtoAndDecodedProto ( sessionEvent: event) { proto in
405
- XCTAssertEqual (
406
- event. proto. application_info. apple_app_info. network_connection_info
407
- . mobile_subtype,
408
- expected
409
- )
410
- }
386
+ for (given, expected) in expectations {
387
+ let mockNetworkInfo = MockNetworkInfo ( )
388
+ mockNetworkInfo. mobileSubtype = given
389
+ appInfo. networkInfo = mockNetworkInfo
390
+
391
+ let event = SessionStartEvent (
392
+ sessionInfo: defaultSessionInfo,
393
+ appInfo: appInfo,
394
+ time: time
395
+ )
396
+
397
+ // These fields will only be filled in when the Perf SDK is installed
398
+ event. set ( subscriber: . Performance, isDataCollectionEnabled: true , appInfo: appInfo)
399
+
400
+ testProtoAndDecodedProto ( sessionEvent: event) { proto in
401
+ XCTAssertEqual (
402
+ event. proto. application_info. apple_app_info. network_connection_info
403
+ . mobile_subtype,
404
+ expected
405
+ )
411
406
}
407
+ }
412
408
}
413
409
#endif // os(iOS) && !targetEnvironment(macCatalyst)
414
410
@@ -477,30 +473,28 @@ class SessionStartEventTests: XCTestCase {
477
473
) ,
478
474
]
479
475
480
- expectations
481
- . forEach { ( given: String ,
482
- expected: firebase_appquality_sessions_NetworkConnectionInfo_MobileSubtype ) in
483
- let mockNetworkInfo = MockNetworkInfo ( )
484
- mockNetworkInfo. mobileSubtype = given
485
- appInfo. networkInfo = mockNetworkInfo
486
-
487
- let event = SessionStartEvent (
488
- sessionInfo: self . defaultSessionInfo,
489
- appInfo: appInfo,
490
- time: time
491
- )
492
-
493
- // These fields will only be filled in when the Perf SDK is installed
494
- event. set ( subscriber: . Performance, isDataCollectionEnabled: true , appInfo: appInfo)
495
-
496
- testProtoAndDecodedProto ( sessionEvent: event) { proto in
497
- XCTAssertEqual (
498
- event. proto. application_info. apple_app_info. network_connection_info
499
- . mobile_subtype,
500
- expected
501
- )
502
- }
476
+ for (given, expected) in expectations {
477
+ let mockNetworkInfo = MockNetworkInfo ( )
478
+ mockNetworkInfo. mobileSubtype = given
479
+ appInfo. networkInfo = mockNetworkInfo
480
+
481
+ let event = SessionStartEvent (
482
+ sessionInfo: defaultSessionInfo,
483
+ appInfo: appInfo,
484
+ time: time
485
+ )
486
+
487
+ // These fields will only be filled in when the Perf SDK is installed
488
+ event. set ( subscriber: . Performance, isDataCollectionEnabled: true , appInfo: appInfo)
489
+
490
+ testProtoAndDecodedProto ( sessionEvent: event) { proto in
491
+ XCTAssertEqual (
492
+ event. proto. application_info. apple_app_info. network_connection_info
493
+ . mobile_subtype,
494
+ expected
495
+ )
503
496
}
497
+ }
504
498
}
505
499
#endif // os(iOS) && !targetEnvironment(macCatalyst)
506
500
}
0 commit comments