예제 #1
0
        public Scheduling Get(Guid key)
        {
            var scheduling = _schedulingRepository.Get(key);

            if (scheduling == null)
            {
                throw new NotFoundException("Scheduling not found");
            }

            return(scheduling);
        }
        public void SchedulingRepository_Update_ShouldBeOk()
        {
            Scheduling scheduling   = _repository.Get(1);
            DateTime   oldStartTime = scheduling.StartTime;

            scheduling.StartTime          = new DateTime(2018, 6, 10, 7, 0, 0);
            scheduling.Room.Disponibility = true;
            Scheduling result = _repository.Update(scheduling);

            result.Should().NotBeNull();
            result.Id.Should().BeGreaterThan(0);
            result.StartTime.Should().NotBe(oldStartTime);
        }
예제 #3
0
        public void SchedulingSqlRepository_Update_ShouldBeOk()
        {
            //Cenário
            Scheduling scheduling   = _repository.Get(1);
            DateTime   oldStartTime = scheduling.StartTime;

            scheduling.StartTime = new DateTime(2018, 6, 10, 7, 0, 0);

            //Ação
            Scheduling result = _repository.Update(scheduling);

            //Verifica
            result.Should().NotBeNull();
            result.Id.Should().BeGreaterThan(0);
            result.StartTime.Should().NotBe(oldStartTime);
        }
예제 #4
0
 public Scheduling Get(long id)
 {
     if (id < 1)
     {
         throw new IdentifierUndefinedException();
     }
     return(_repository.Get(id));
 }