Skip to content

Commit

Permalink
[#11736] Tests Housekeeping (#11737)
Browse files Browse the repository at this point in the history
  • Loading branch information
yakovmanshin authored Aug 29, 2023
1 parent c39ef81 commit 732c1ce
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions FirebaseFunctions/Tests/Integration/IntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ class IntegrationTests: XCTestCase {
XCTAssertEqual(FunctionsErrorCode.outOfRange.rawValue, error.code)
XCTAssertEqual("explicit nope", error.localizedDescription)
XCTAssertEqual(["start": 10 as Int32, "end": 20 as Int32, "long": 30],
error.userInfo["details"] as! [String: Int32])
error.userInfo["details"] as? [String: Int32])
expectation.fulfill()
return
}
Expand Down Expand Up @@ -591,7 +591,7 @@ class IntegrationTests: XCTestCase {
XCTAssertEqual(FunctionsErrorCode.outOfRange.rawValue, error.code)
XCTAssertEqual("explicit nope", error.localizedDescription)
XCTAssertEqual(["start": 10 as Int32, "end": 20 as Int32, "long": 30],
error.userInfo["details"] as! [String: Int32])
error.userInfo["details"] as? [String: Int32])
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions FirebaseSessions/Tests/Unit/RemoteSettingsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ class RemoteSettingsTests: XCTestCase {
"sessions_enabled": false,
"sampling_rate": 0.5,
"session_timeout_seconds": 10,
],
] as [String: Any],
]
let validSettings2: [String: Any] = [
"cache_duration": 20,
"app_quality": [
"sessions_enabled": true,
"sampling_rate": 0.2,
"session_timeout_seconds": 20,
],
] as [String: Any],
]
let corruptedJSONString: String = "{{{{ non_key: non\"value {}"
var cache: SettingsCacheClient!
Expand Down
5 changes: 2 additions & 3 deletions FirebaseSessions/Tests/Unit/SessionsSettingsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SessionsSettingsTests: XCTestCase {
"sessions_enabled": false,
"sampling_rate": 0.5,
"session_timeout_seconds": 10,
],
] as [String: Any],
]

var cache: SettingsCacheClient!
Expand Down Expand Up @@ -65,8 +65,7 @@ class SessionsSettingsTests: XCTestCase {
func test_NoRemoteAndDefaultsPresent_DefaultConfigsApply() {
let emptySettings: [String: Any] = [
"cache_duration": 10,
"app_quality": [
],
"app_quality": [:] as [String: Any],
]

cache.removeCache()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class FirebaseFirebaseDataEncoderTests: XCTestCase {
"weight": 79.2,
],
],
],
] as [String: Any],
"id": 123,
] as [String: Any]

Expand Down Expand Up @@ -383,7 +383,7 @@ class FirebaseFirebaseDataEncoderTests: XCTestCase {
func testClassHierarchy() {
assertThat(SubModel(power: 100, name: "name", seconds: 123_456_789.123))
.roundTrips(to: [
"super": ["superPower": 100, "superName": "name"],
"super": ["superPower": 100, "superName": "name"] as [String: Any],
"timestamp": 123_456_789.123,
])
}
Expand Down

0 comments on commit 732c1ce

Please sign in to comment.