Esempio n. 1
0
        public void Rollback_restores_state_to_given_snapshot()
        {
            var workTime = WorkTimeTestUtils.CreateManual();

            workTime.StartManually();
            var snap = workTime.TakeSnapshot();

            workTime.AddMouseAction(new MouseKeyboardEvent());
            _repository.Save(workTime);
            workTime.MarkPendingEventsAsHandled();

            _repository.Rollback(snap);
            workTime.RollbackToSnapshot(snap);

            var found = _repository.Find(workTime.User, workTime.DateCreated);

            found.Should().BeEquivalentTo(workTime, opt => opt.Excluding(t => t.FromSnapshot));
        }
Esempio n. 2
0
 public void Rollback()
 {
     _repository.Rollback(_snapshot);
     _workTime.RollbackToSnapshot(_snapshot);
 }
Esempio n. 3
0
 public void Rollback(WorkTimeSnapshotCreated snapshot)
 {
     _repository.Rollback(snapshot);
 }