How to mock SBDGroupChannel?

I’m trying to mock a SBDGroupChannel, but the initializer is not public. So, I cant create a mock to it. Is there a way of doing it?

I’ve found this method, but what kind of data should I pass in order to return a channel?

SBDGroupChannel.build(fromSerializedData: _) -> SBDGroupChannel?

@ramonpicoplay it accepts NSData that contains dictionary form of group channel. We do not provide public initializer at this moment. Are you trying to mock for unit test?

@Woo Yes, I’m trying to mock for unit tests only. Do you have an example of how can I implement with that dictionary?

Which String encoding do you use?
I was trying do reverse engineering from groupChannel.serialize() method. But when you try to deserialize that data into a string like String(data: groupChannelData, encoding: .utf8) it retrieves nil.
I’ve tried some other encodings bot none of them could give me a legible string.

@ramonpicoplay hey sorry for late response. I came back to the states and been quite busy to handle other tasks. I think I can talk with my team regards to opening initWithDictionary methods to public if you really need this.

That would be great! I’m looking forward to it. :wink: