Esempio n. 1
0
        public void DeregisterPeer()
        {
            var swarm = new Swarm {
                LocalPeer = self
            };

            swarm.RegisterPeer(other);
            Assert.IsTrue(swarm.KnownPeers.Contains(other));

            Peer removedPeer = null;

            swarm.PeerRemoved += (s, e) => removedPeer = e;
            swarm.DeregisterPeer(other);
            Assert.IsFalse(swarm.KnownPeers.Contains(other));
            Assert.AreEqual(other, removedPeer);
        }