Exemple #1
0
        public void Should_Map()
        {
            // Arrange
            var dto = new AppointmentSetDatesDto
            {
                Id   = Guid.NewGuid(),
                Body = new AppointmentSetDatesBodyDto
                {
                    StartTime = FakeDateTime.UtcNow,
                    EndTime   = FakeDateTime.UtcNow.AddHours(2)
                }
            };
            var expectedCommand = new SetDates.Command
            {
                Id        = dto.Id,
                StartTime = dto.Body.StartTime,
                EndTime   = dto.Body.EndTime
            };

            // Act
            SetDates.Command command = _mapper.Map <SetDates.Command>(dto);

            // Assert
            command.Should().BeEquivalentTo(expectedCommand);
        }
Exemple #2
0
        public async Task <AppointmentDto> SetDatesAsync(AppointmentSetDatesDto setDatesDto)
        {
            SetDates.Command command     = _mapper.Map <SetDates.Command>(setDatesDto);
            Appointment      appointment = await _mediator.Send(command);

            AppointmentDto dto       = _mapper.Map <AppointmentDto>(appointment);
            var            treeQuery = new Domain.Logic.Sections.FlattenedTree.Query();
            IEnumerable <ITree <Section> > flattenedTree = await _mediator.Send(treeQuery);

            await AddParticipationsAsync(dto, appointment, flattenedTree);

            return(dto);
        }
Exemple #3
0
 public async Task <ActionResult <AppointmentDto> > SetDates(AppointmentSetDatesDto setDatesDto)
 {
     return(await _appointmentService.SetDatesAsync(setDatesDto));
 }