mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 00:05:18 +00:00
Swift Testing (#748)
* Swift Testing: `PrivateChatE2ETests` + minor refactor * Swift Testing: `PublicChatE2ETests` * Swift Testing: `FragmentationTests` * Fix MockBLEService init to accept PeerID and remove _testRegister call * Add peerID property to MockBLEService and fix ttlDecrement test * Remove duplicate peerID property and fix type comparisons --------- Co-authored-by: jack <jackjackbits@users.noreply.github.com>
This commit is contained in:
@@ -349,3 +349,18 @@ final class MockBLEService: NSObject {
|
||||
|
||||
// Backward compatibility for older tests
|
||||
typealias MockSimplifiedBluetoothService = MockBLEService
|
||||
|
||||
// MARK: - Helpers
|
||||
|
||||
extension MockBLEService {
|
||||
convenience init(peerID: PeerID, nickname: String) {
|
||||
self.init()
|
||||
myPeerID = peerID.id
|
||||
mockNickname = nickname
|
||||
}
|
||||
|
||||
func simulateConnection(with otherPeer: MockBLEService) {
|
||||
simulateConnectedPeer(otherPeer.myPeerID)
|
||||
otherPeer.simulateConnectedPeer(myPeerID)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user