Ejemplo n.º 1
0
 /// <inheritdoc />
 public void RestoreMemento(IHastingsMemento hastingsMemento)
 {
     Logger.Debug("Restoring memento with Peer {peer} and neighbours [{neighbours}]", hastingsMemento.Peer);
     Peer             = hastingsMemento.Peer;
     Neighbours       = hastingsMemento.Neighbours;
     PnrCorrelationId = CorrelationId.GenerateCorrelationId();
 }
Ejemplo n.º 2
0
        public DiscoveryTestBuilder WithCurrentStep(IHastingsMemento currentStep = default,
                                                    bool mock              = false,
                                                    PeerId peer            = default,
                                                    INeighbours neighbours = default)
        {
            if (_careTaker == null)
            {
                WithCareTaker();
            }

            var memento = mock
                ? currentStep ?? DiscoveryHelper.MockMemento(peer, neighbours)
                : currentStep ?? DiscoveryHelper.SubMemento(peer, neighbours);

            _careTaker.Add(memento);

            return(this);
        }
Ejemplo n.º 3
0
 public HastingsOriginator(IHastingsMemento hastingsMemento)
 {
     PnrCorrelationId = CorrelationId.GenerateCorrelationId();
     Peer             = hastingsMemento?.Peer;
     Neighbours       = hastingsMemento?.Neighbours ?? new Neighbours();
 }
Ejemplo n.º 4
0
 /// <inheritdoc />
 public void Add(IHastingsMemento hastingsMemento)
 {
     HastingMementoList.Push(hastingsMemento);
 }