Beispiel #1
0
        public void Test()
        {
            _sagaState = new SoftwareProgrammingSagaState(Guid.NewGuid(), SoftwareProgrammingSaga.States.MakingCoffee);
            _sagaState.RememberPerson(Guid.NewGuid());
            _sagaState.ClearEvents();

            var data = DomainSerializer.Serialize(_sagaState);

            _restoredState = DomainSerializer.Deserialize <SoftwareProgrammingSagaState>(data);
        }
Beispiel #2
0
        public void Test()
        {
            _sagaState = new SoftwareProgrammingSagaState(Guid.NewGuid(), SoftwareProgrammingSaga.States.MakingCoffee);
            _sagaState.RememberPerson(Guid.NewGuid());
            _sagaState.RememberBadCoffeMachine(Guid.NewGuid());
            _sagaState.ClearEvents();

            var repo = new AggregateSnapshotRepository(AkkaConf.Persistence.JournalConnectionString, GridNode.AggregateFromSnapshotsFactory);

            repo.Add(_sagaState);

            _restoredState = LoadSagaState <SoftwareProgrammingSaga, SoftwareProgrammingSagaState>(_sagaState.Id);
        }