public void Can_Restore_State_From_Memento_And_Assign_New_CorrelationId() { var memento = DiscoveryHelper.MockMemento(); var originator = new HastingsOriginator(memento); originator.RestoreMemento(memento); originator.Peer.Should().Be(memento.Peer); originator.Neighbours.Should().BeEquivalentTo(memento.Neighbours); originator.PnrCorrelationId.Should().NotBe(default);
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); }