示例#1
0
        public async Task ProcessPeerDiscoveryJob_Test()
        {
            _peerDiscoveryWorker.ShouldNotBeNull();

            var beforePeers = _networkService.GetPeers().Count;

            await _peerDiscoveryWorker.ProcessPeerDiscoveryJob();

            var afterDiscoveryPeers = _networkService.GetPeers().Count;

            beforePeers.ShouldBe(afterDiscoveryPeers);
        }
示例#2
0
        public async Task ProcessPeerDiscoveryJob_Test()
        {
            _peerDiscoveryWorker.ShouldNotBeNull();

            var beforePeers = _networkService.GetPeers().Count;

            await _peerDiscoveryWorker.ProcessPeerDiscoveryJob();

            var afterDiscoveryPeers = _networkService.GetPeers().Count;

            beforePeers.ShouldBe(afterDiscoveryPeers);

            var peer = CreateNewPeer();

            peer.IsConnected = true;
            _peerPool.TryAddPeer(peer);

            await _peerDiscoveryWorker.ProcessPeerDiscoveryJob();

            afterDiscoveryPeers = _networkService.GetPeers().Count;
            afterDiscoveryPeers.ShouldBe(beforePeers + 1);
        }