public SyncingContext AfterPeerIsAdded(ISyncPeer syncPeer) { ((SyncPeerMock)syncPeer).Disconnected += (s, e) => SyncPeerPool.RemovePeer(syncPeer); _logger.Info($"PEER ADDED {syncPeer.ClientId}"); _peers.TryAdd(syncPeer.ClientId, syncPeer); SyncPeerPool.AddPeer(syncPeer); return(this); }
public void Cannot_add_when_not_started() { for (int i = 0; i < 3; i++) { Assert.AreEqual(0, _pool.PeerCount); _pool.AddPeer(new SimpleSyncPeerMock(TestItem.PublicKeys[i])); } }