public void f() { var workTime = WorkTimeTestUtils.CreateManual(); _repository.Save(workTime); workTime.MarkPendingEventsAsHandled(); for (int i = 0; i < 2; i++) { _uow.RegisterNew(workTime); workTime.StartManually(); _uow.Save(); var found = _repository.Find(workTime.User, DateTime.UtcNow); found.Started.Should().BeTrue(); _uow.Rollback(); found = _repository.Find(workTime.User, DateTime.UtcNow); found.Started.Should().BeFalse(); _repository.CountForUser(workTime.User).Should().Be(1); } }
public void StartTempChanges() { Debug.Assert(WorkTime != null); Debug.WriteLine("Starting temp changes"); if (_uow.HasRegistered) { _uow.Unregister(WorkTime); } _uow.RegisterNew(WorkTime); }