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); }
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); }
public Scheduling Get(long id) { if (id < 1) { throw new IdentifierUndefinedException(); } return(_repository.Get(id)); }