예제 #1
0
        public void Should_Map()
        {
            // Arrange
            var dto = new SetProjectParticipationDto
            {
                Id   = Guid.NewGuid(),
                Body = new SetProjectParticipationBodyDto
                {
                    CommentByStaffInner           = "CommentByStaffInner",
                    CommentTeam                   = "CommentTeam",
                    InvitationStatusId            = Guid.NewGuid(),
                    MusicianProfileId             = Guid.NewGuid(),
                    ParticipationStatusInnerId    = Guid.NewGuid(),
                    ParticipationStatusInternalId = Guid.NewGuid()
                }
            };
            var expectedCommand = new SetProjectParticipation.Command
            {
                ProjectId                     = dto.Id,
                CommentByStaffInner           = dto.Body.CommentByStaffInner,
                CommentTeam                   = dto.Body.CommentTeam,
                InvitationStatusId            = dto.Body.InvitationStatusId,
                MusicianProfileId             = dto.Body.MusicianProfileId,
                ParticipationStatusInnerId    = dto.Body.ParticipationStatusInnerId,
                ParticipationStatusInternalId = dto.Body.ParticipationStatusInternalId
            };

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

            // Assert
            command.Should().BeEquivalentTo(expectedCommand);
        }
예제 #2
0
        public async Task <ProjectParticipationDto> SetProjectParticipationAsync(SetProjectParticipationDto myProjectParticipationDto)
        {
            SetProjectParticipation.Command command = _mapper
                                                      .Map <SetProjectParticipation.Command>(myProjectParticipationDto);

            ProjectParticipation projectParticipation = await _mediator.Send(command);

            return(_mapper.Map <ProjectParticipationDto>(projectParticipation));
        }
예제 #3
0
 public async Task <ActionResult <ProjectParticipationDto> > SetProjectParticipation(SetProjectParticipationDto myProjectParticipationDto)
 {
     return(Ok(await _projectService.SetProjectParticipationAsync(myProjectParticipationDto)));
 }