@@ -23,16 +23,16 @@ class MockRooms: Rooms {
2323 let clientOptions : ChatClientOptions
2424 private var rooms = [ String: MockRoom] ( )
2525
26- func get( roomID : String , options: RoomOptions ) async throws ( ARTErrorInfo) -> any Room {
27- if let room = rooms [ roomID ] {
26+ func get( name : String , options: RoomOptions ) async throws ( ARTErrorInfo) -> any Room {
27+ if let room = rooms [ name ] {
2828 return room
2929 }
30- let room = MockRoom ( roomID : roomID , options: options)
31- rooms [ roomID ] = room
30+ let room = MockRoom ( name : name , options: options)
31+ rooms [ name ] = room
3232 return room
3333 }
3434
35- func release( roomID _: String ) async {
35+ func release( name _: String ) async {
3636 fatalError ( " Not yet implemented " )
3737 }
3838
@@ -44,7 +44,7 @@ class MockRooms: Rooms {
4444class MockRoom : Room {
4545 private let clientID = " AblyTest "
4646
47- nonisolated let roomID : String
47+ nonisolated let name : String
4848 nonisolated let options : RoomOptions
4949 nonisolated let messages : any Messages
5050 nonisolated let presence : any Presence
@@ -54,14 +54,14 @@ class MockRoom: Room {
5454
5555 let channel : any RealtimeChannelProtocol = MockRealtime . Channel ( )
5656
57- init ( roomID : String , options: RoomOptions ) {
58- self . roomID = roomID
57+ init ( name : String , options: RoomOptions ) {
58+ self . name = name
5959 self . options = options
60- messages = MockMessages ( clientID: clientID, roomID : roomID )
61- presence = MockPresence ( clientID: clientID, roomID : roomID )
62- reactions = MockRoomReactions ( clientID: clientID, roomID : roomID )
63- typing = MockTyping ( clientID: clientID, roomID : roomID )
64- occupancy = MockOccupancy ( clientID: clientID, roomID : roomID )
60+ messages = MockMessages ( clientID: clientID, roomName : name )
61+ presence = MockPresence ( clientID: clientID, roomName : name )
62+ reactions = MockRoomReactions ( clientID: clientID, roomName : name )
63+ typing = MockTyping ( clientID: clientID, roomName : name )
64+ occupancy = MockOccupancy ( clientID: clientID, roomName : name )
6565 }
6666
6767 var status : RoomStatus = . initialized
@@ -73,7 +73,7 @@ class MockRoom: Room {
7373 }
7474
7575 func attach( ) async throws ( ARTErrorInfo) {
76- print ( " Mock client attached to room with roomID : \( roomID ) " )
76+ print ( " Mock client attached to room with roomName : \( name ) " )
7777 }
7878
7979 func detach( ) async throws ( ARTErrorInfo) {
@@ -105,7 +105,7 @@ class MockRoom: Room {
105105
106106class MockMessages : Messages {
107107 let clientID : String
108- let roomID : String
108+ let roomName : String
109109
110110 var reactions : any MessageReactions
111111
@@ -116,10 +116,10 @@ class MockMessages: Messages {
116116
117117 private let mockSubscriptions = MockMessageSubscriptionStorage < Message > ( )
118118
119- init ( clientID: String , roomID : String ) {
119+ init ( clientID: String , roomName : String ) {
120120 self . clientID = clientID
121- self . roomID = roomID
122- reactions = MockMessageReactions ( clientID: clientID, roomID : roomID )
121+ self . roomName = roomName
122+ reactions = MockMessageReactions ( clientID: clientID, roomName : roomName )
123123 }
124124
125125 func subscribe( _ callback: @escaping @MainActor ( Message ) -> Void ) async throws ( ARTErrorInfo) -> MessageSubscriptionResponseProtocol {
@@ -129,7 +129,6 @@ class MockMessages: Messages {
129129 serial: " \( Date ( ) . timeIntervalSince1970) " ,
130130 action: . create,
131131 clientID: MockStrings . names. randomElement ( ) !,
132- roomID: self . roomID,
133132 text: MockStrings . randomPhrase ( ) ,
134133 createdAt: Date ( ) ,
135134 metadata: [ : ] ,
@@ -145,23 +144,22 @@ class MockMessages: Messages {
145144 return message
146145 } ,
147146 previousMessages: { _ in
148- MockMessagesPaginatedResult ( clientID: self . clientID, roomID : self . roomID )
147+ MockMessagesPaginatedResult ( clientID: self . clientID, roomName : self . roomName )
149148 } ,
150149 interval: 3.0 ,
151150 callback: callback
152151 )
153152 }
154153
155154 func get( options _: QueryOptions ) async throws ( ARTErrorInfo) -> any PaginatedResult < Message > {
156- MockMessagesPaginatedResult ( clientID: clientID, roomID : roomID )
155+ MockMessagesPaginatedResult ( clientID: clientID, roomName : roomName )
157156 }
158157
159158 func send( params: SendMessageParams ) async throws ( ARTErrorInfo) -> Message {
160159 let message = Message (
161160 serial: " \( Date ( ) . timeIntervalSince1970) " ,
162161 action: . create,
163162 clientID: clientID,
164- roomID: roomID,
165163 text: params. text,
166164 createdAt: Date ( ) ,
167165 metadata: params. metadata ?? [ : ] ,
@@ -179,7 +177,6 @@ class MockMessages: Messages {
179177 serial: newMessage. serial,
180178 action: . update,
181179 clientID: clientID,
182- roomID: roomID,
183180 text: newMessage. text,
184181 createdAt: Date ( ) ,
185182 metadata: newMessage. metadata,
@@ -197,7 +194,6 @@ class MockMessages: Messages {
197194 serial: message. serial,
198195 action: . delete,
199196 clientID: clientID,
200- roomID: roomID,
201197 text: message. text,
202198 createdAt: Date ( ) ,
203199 metadata: message. metadata,
@@ -213,7 +209,7 @@ class MockMessages: Messages {
213209
214210class MockMessageReactions : MessageReactions {
215211 let clientID : String
216- let roomID : String
212+ let roomName : String
217213
218214 var clientIDs : Set < String > = [ ]
219215 var messageSerials : [ String ] = [ ]
@@ -241,9 +237,9 @@ class MockMessageReactions: MessageReactions {
241237 )
242238 }
243239
244- init ( clientID: String , roomID : String ) {
240+ init ( clientID: String , roomName : String ) {
245241 self . clientID = clientID
246- self . roomID = roomID
242+ self . roomName = roomName
247243 }
248244
249245 func send( to messageSerial: String , params: SendMessageReactionParams ) async throws ( ARTErrorInfo) {
@@ -310,13 +306,13 @@ class MockMessageReactions: MessageReactions {
310306
311307class MockRoomReactions : RoomReactions {
312308 let clientID : String
313- let roomID : String
309+ let roomName : String
314310
315311 private let mockSubscriptions = MockSubscriptionStorage < Reaction > ( )
316312
317- init ( clientID: String , roomID : String ) {
313+ init ( clientID: String , roomName : String ) {
318314 self . clientID = clientID
319- self . roomID = roomID
315+ self . roomName = roomName
320316 }
321317
322318 func send( params: SendReactionParams ) async throws ( ARTErrorInfo) {
@@ -352,13 +348,13 @@ class MockRoomReactions: RoomReactions {
352348
353349class MockTyping : Typing {
354350 let clientID : String
355- let roomID : String
351+ let roomName : String
356352
357353 private let mockSubscriptions = MockSubscriptionStorage < TypingSetEvent > ( )
358354
359- init ( clientID: String , roomID : String ) {
355+ init ( clientID: String , roomName : String ) {
360356 self . clientID = clientID
361- self . roomID = roomID
357+ self . roomName = roomName
362358 }
363359
364360 @discardableResult
@@ -406,13 +402,13 @@ class MockTyping: Typing {
406402
407403class MockPresence : Presence {
408404 let clientID : String
409- let roomID : String
405+ let roomName : String
410406
411407 private let mockSubscriptions = MockSubscriptionStorage < PresenceEvent > ( )
412408
413- init ( clientID: String , roomID : String ) {
409+ init ( clientID: String , roomName : String ) {
414410 self . clientID = clientID
415- self . roomID = roomID
411+ self . roomName = roomName
416412 }
417413
418414 private func createSubscription( callback: @escaping @MainActor ( PresenceEvent ) -> Void ) -> SubscriptionProtocol {
@@ -526,13 +522,13 @@ class MockPresence: Presence {
526522
527523class MockOccupancy : Occupancy {
528524 let clientID : String
529- let roomID : String
525+ let roomName : String
530526
531527 private let mockSubscriptions = MockSubscriptionStorage < OccupancyEvent > ( )
532528
533- init ( clientID: String , roomID : String ) {
529+ init ( clientID: String , roomName : String ) {
534530 self . clientID = clientID
535- self . roomID = roomID
531+ self . roomName = roomName
536532 }
537533
538534 @discardableResult
0 commit comments