コード例 #1
0
ファイル: Neighbour.cs プロジェクト: umlspec/Catalyst
 public Neighbour(PeerId peerId,
                  NeighbourStateTypes stateTypes            = default,
                  ICorrelationId discoveryPingCorrelationId = default)
 {
     PeerId     = peerId;
     StateTypes = stateTypes ?? NeighbourStateTypes.NotContacted;
     DiscoveryPingCorrelationId = discoveryPingCorrelationId;
 }
コード例 #2
0
        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));
        }