Skip to content

Commit 5216383

Browse files
committed
Fix Sendable warnings in test file
1 parent 2dba2ac commit 5216383

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

FirebaseAuth/Tests/Unit/AuthBackendTests.swift

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ class AuthBackendTests: RPCBaseTests {
529529
try self.rpcIssuer.respond(withJSON: [kTestKey: kTestValue])
530530
}
531531
let rpcResponse = try await AuthBackend.call(with: FakeRequest(withRequestBody: [:]))
532-
XCTAssertEqual(try XCTUnwrap(rpcResponse.receivedDictionary[kTestKey] as? String), kTestValue)
532+
XCTAssertEqual(try XCTUnwrap(rpcResponse.receivedValue), kTestValue)
533533
}
534534

535535
#if COCOAPODS || SWIFT_PACKAGE
@@ -711,12 +711,10 @@ class AuthBackendTests: RPCBaseTests {
711711
}
712712
}
713713

714-
private class FakeResponse: AuthRPCResponse {
715-
required init() {}
716-
717-
var receivedDictionary: [String: AnyHashable] = [:]
718-
func setFields(dictionary: [String: AnyHashable]) throws {
719-
receivedDictionary = dictionary
714+
private struct FakeResponse: AuthRPCResponse {
715+
var receivedValue: String?
716+
mutating func setFields(dictionary: [String: AnyHashable]) throws {
717+
receivedValue = dictionary["TestKey"] as? String
720718
}
721719
}
722720

@@ -740,10 +738,8 @@ class AuthBackendTests: RPCBaseTests {
740738
}
741739
}
742740

743-
private class FakeDecodingErrorResponse: FakeResponse {
744-
required init() {}
745-
746-
override func setFields(dictionary: [String: AnyHashable]) throws {
741+
private struct FakeDecodingErrorResponse: AuthRPCResponse {
742+
mutating func setFields(dictionary: [String: AnyHashable]) throws {
747743
throw NSError(domain: "dummy", code: -1)
748744
}
749745
}

0 commit comments

Comments
 (0)