Ejemplo n.º 1
0
        public void Should_Map()
        {
            // Arrange
            var dto = new MyMusicianProfileCreateDto
            {
                LevelAssessmentInner = 1,
                InstrumentId         = Guid.NewGuid(),
                InquiryStatusInnerId = Guid.NewGuid(),
            };

            dto.PreferredPositionsInnerIds.Add(Guid.NewGuid());
            dto.DoublingInstruments.Add(new MyDoublingInstrumentCreateDto
            {
                AvailabilityId       = Guid.NewGuid(),
                Comment              = "Comment",
                InstrumentId         = Guid.NewGuid(),
                LevelAssessmentInner = 2,
            });
            dto.PreferredPartsInner.Add(4);

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

            // Assert
            command.Should().BeEquivalentTo(dto);
        }
Ejemplo n.º 2
0
        public void Should_Map()
        {
            // Arrange
            var regionDto = new RegionCreateDto {
                Name = "Name"
            };
            var expectedCommand = new Create.Command {
                Name = regionDto.Name
            };

            // Act
            Create.Command command = _mapper.Map <Create.Command>(regionDto);

            // Assert
            command.Should().BeEquivalentTo(expectedCommand);
        }
Ejemplo n.º 3
0
        public void Should_Map()
        {
            // Arrange
            AppointmentCreateDto dto = new Faker <AppointmentCreateDto>()
                                       .RuleFor(dto => dto.InternalDetails, (f, u) => f.Lorem.Paragraph())
                                       .RuleFor(dto => dto.PublicDetails, (f, u) => f.Lorem.Paragraph())
                                       .RuleFor(dto => dto.Name, (f, u) => f.Name.FirstName())
                                       .RuleFor(dto => dto.StartTime, (f, u) => f.Date.Soon())
                                       .RuleFor(dto => dto.EndTime, (f, u) => f.Date.Soon())
                                       .RuleFor(dto => dto.CategoryId, f => Guid.NewGuid())
                                       .RuleFor(dto => dto.SalaryId, f => Guid.NewGuid())
                                       .RuleFor(dto => dto.SalaryPatternId, f => Guid.NewGuid())
                                       .RuleFor(dto => dto.StatusId, f => Guid.NewGuid())
                                       .RuleFor(dto => dto.ExpectationId, f => Guid.NewGuid())
                                       .Generate();

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

            // Assert
            command.Should().BeEquivalentTo(dto);
        }
Ejemplo n.º 4
0
        public void Should_Map()
        {
            // Arrange
            ProjectCreateDto dto = new Faker <ProjectCreateDto>()
                                   .RuleFor(dto => dto.Title, (f) => f.Lorem.Paragraph(50))
                                   .RuleFor(dto => dto.ShortTitle, (f) => f.Lorem.Paragraph(8))
                                   .RuleFor(dto => dto.Description, (f) => f.Lorem.Paragraph())
                                   .RuleFor(dto => dto.Code, "0815ABC")
                                   .RuleFor(dto => dto.TypeId, Guid.NewGuid())
                                   .RuleFor(dto => dto.GenreId, Guid.NewGuid())
                                   .RuleFor(dto => dto.StartDate, new DateTime(2022, 03, 03))
                                   .RuleFor(dto => dto.EndDate, new DateTime(2022, 04, 04))
                                   .RuleFor(dto => dto.StateId, Guid.NewGuid())
                                   .RuleFor(dto => dto.IsCompleted, true)
                                   .RuleFor(dto => dto.ParentId, (f) => f.Random.Guid())
                                   .Generate();

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

            // Assert
            command.Should().BeEquivalentTo(dto);
        }
Ejemplo n.º 5
0
        public void Should_Map()
        {
            // Arrange
            var dto = new MusicianProfileCreateDto
            {
                Id   = Guid.NewGuid(),
                Body = new MusicianProfileCreateBodyDto
                {
                    LevelAssessmentInner = 1,
                    LevelAssessmentTeam  = 2,
                    InstrumentId         = Guid.NewGuid(),
                    QualificationId      = Guid.NewGuid(),
                    InquiryStatusInnerId = Guid.NewGuid(),
                    InquiryStatusTeamId  = Guid.NewGuid(),
                }
            };

            dto.Body.PreferredPositionsInnerIds.Add(Guid.NewGuid());
            dto.Body.PreferredPositionsTeamIds.Add(Guid.NewGuid());
            dto.Body.DoublingInstruments.Add(new DoublingInstrumentCreateDto
            {
                AvailabilityId       = Guid.NewGuid(),
                Comment              = "Comment",
                InstrumentId         = Guid.NewGuid(),
                LevelAssessmentInner = 2,
                LevelAssessmentTeam  = 3
            });
            dto.Body.PreferredPartsInner.Add(4);
            dto.Body.PreferredPartsTeam.Add(2);

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

            // Assert
            command.Should().BeEquivalentTo(dto.Body);
            command.PersonId.Should().Be(dto.Id);
        }