@@ -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