public Neighbour(PeerId peerId, NeighbourStateTypes stateTypes = default, ICorrelationId discoveryPingCorrelationId = default) { PeerId = peerId; StateTypes = stateTypes ?? NeighbourStateTypes.NotContacted; DiscoveryPingCorrelationId = discoveryPingCorrelationId; }
public static INeighbours MockNeighbours(int amount = 5, NeighbourStateTypes stateTypes = null, ICorrelationId correlationId = default) { var neighbours = Enumerable.Range(0, amount).Select(i => new Neighbour( PeerIdHelper.GetPeerId( StringHelper.RandomString() ), stateTypes ?? NeighbourStateTypes.NotContacted, correlationId ?? CorrelationId.GenerateCorrelationId())); return(new Neighbours(neighbours)); }