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

            _repository.Save(workTime);

            _repository.CountForUser(workTime.User).Should().Be(1);
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
 public int CountForUser(User user)
 {
     return(_repository.CountForUser(user));
 }