From 2575af452dfa92ae123897fc94fbe390e822ed72 Mon Sep 17 00:00:00 2001 From: VILLAN3LL3 Date: Sun, 15 Dec 2024 18:36:15 +0100 Subject: [PATCH 1/3] added type to curriculumvitaereferencedto --- .../Model/CurriculumVitaeReferenceDto.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Orso.Arpa.Application/CurriculumVitaeReferenceApplication/Model/CurriculumVitaeReferenceDto.cs b/Orso.Arpa.Application/CurriculumVitaeReferenceApplication/Model/CurriculumVitaeReferenceDto.cs index eb75c29d0..abb48a7c5 100644 --- a/Orso.Arpa.Application/CurriculumVitaeReferenceApplication/Model/CurriculumVitaeReferenceDto.cs +++ b/Orso.Arpa.Application/CurriculumVitaeReferenceApplication/Model/CurriculumVitaeReferenceDto.cs @@ -1,6 +1,7 @@ using System; using AutoMapper; using Orso.Arpa.Application.General.Model; +using Orso.Arpa.Application.SelectValueApplication.Model; using Orso.Arpa.Domain.General.Model; using Orso.Arpa.Domain.MusicianProfileDomain.Model; @@ -13,6 +14,7 @@ public class CurriculumVitaeReferenceDto : BaseEntityDto public Guid? TypeId { get; set; } public string Description { get; set; } public byte? SortOrder { get; set; } + public SelectValueDto Type { get; set; } } public class CurriculumVitaeReferenceDtoMappingProfile : Profile From b05293dfb1a6ca73c712a8f4f690e00997cb2354 Mon Sep 17 00:00:00 2001 From: VILLAN3LL3 Date: Sun, 15 Dec 2024 19:15:15 +0100 Subject: [PATCH 2/3] test adaptions --- .../Model/CurriculumVitaeReference.cs | 1 - .../MusicianProfileControllerTests.cs | 3 ++- .../DtoTestData/CurriculumVitaeReferenceDtoData.cs | 3 ++- .../DtoTestData/SelectValueDtoData.cs | 12 ++++++++++++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Orso.Arpa.Domain/MusicianProfileDomain/Model/CurriculumVitaeReference.cs b/Orso.Arpa.Domain/MusicianProfileDomain/Model/CurriculumVitaeReference.cs index 03deda32b..28a6aba98 100644 --- a/Orso.Arpa.Domain/MusicianProfileDomain/Model/CurriculumVitaeReference.cs +++ b/Orso.Arpa.Domain/MusicianProfileDomain/Model/CurriculumVitaeReference.cs @@ -33,7 +33,6 @@ public void Update(ModifyCurriculumVitaeReference.Command command) Institution = command.Institution; TypeId = command.TypeId; Description = command.Description; - Description = command.Description; SortOrder = command.SortOrder; } diff --git a/Tests/Orso.Arpa.Api.Tests/IntegrationTests/MusicianProfileControllerTests.cs b/Tests/Orso.Arpa.Api.Tests/IntegrationTests/MusicianProfileControllerTests.cs index a2f3c5b8f..f9a6aae0f 100644 --- a/Tests/Orso.Arpa.Api.Tests/IntegrationTests/MusicianProfileControllerTests.cs +++ b/Tests/Orso.Arpa.Api.Tests/IntegrationTests/MusicianProfileControllerTests.cs @@ -293,7 +293,8 @@ public async Task Should_Add_CurriculumVitaeReference() Description = createDto.Description, SortOrder = createDto.SortOrder, CreatedBy = _staff.DisplayName, - CreatedAt = FakeDateTime.UtcNow + CreatedAt = FakeDateTime.UtcNow, + Type = SelectValueDtoData.SoloPerformance }; // Act diff --git a/Tests/Orso.Arpa.Tests.Shared/DtoTestData/CurriculumVitaeReferenceDtoData.cs b/Tests/Orso.Arpa.Tests.Shared/DtoTestData/CurriculumVitaeReferenceDtoData.cs index e06f9afd5..351dda318 100644 --- a/Tests/Orso.Arpa.Tests.Shared/DtoTestData/CurriculumVitaeReferenceDtoData.cs +++ b/Tests/Orso.Arpa.Tests.Shared/DtoTestData/CurriculumVitaeReferenceDtoData.cs @@ -32,7 +32,8 @@ public static CurriculumVitaeReferenceDto Mozarteum SortOrder = 1, Id = Guid.Parse("ea0ad4a1-9351-457f-ab82-24e593e062a1"), CreatedAt = FakeDateTime.UtcNow, - CreatedBy = "anonymous" + CreatedBy = "anonymous", + Type = SelectValueDtoData.EnsemblePosition }; } } diff --git a/Tests/Orso.Arpa.Tests.Shared/DtoTestData/SelectValueDtoData.cs b/Tests/Orso.Arpa.Tests.Shared/DtoTestData/SelectValueDtoData.cs index 554d3ca13..f09aed351 100644 --- a/Tests/Orso.Arpa.Tests.Shared/DtoTestData/SelectValueDtoData.cs +++ b/Tests/Orso.Arpa.Tests.Shared/DtoTestData/SelectValueDtoData.cs @@ -239,5 +239,17 @@ public static IList ProjectGenres Name = "University", Description = "" }; + + public static SelectValueDto SoloPerformance => new() { + Id = Guid.Parse("3245182e-7985-4c07-828e-d69287ff2a2d"), + Name = "Solo performance", + Description = "" + }; + + public static SelectValueDto EnsemblePosition => new() { + Id = Guid.Parse("dead0ae2-bb2b-4584-992e-dddeb7f23d53"), + Name = "Ensemble position", + Description = "" + }; } } From 4b1df1ac71200478de11da1f4af97e927a06c6ca Mon Sep 17 00:00:00 2001 From: VILLAN3LL3 Date: Sun, 15 Dec 2024 19:19:29 +0100 Subject: [PATCH 3/3] fixed mapping tests --- .../FakeData/FakeMusicianProfiles.cs | 5 +++-- .../FakeData/FakeSelectValueMappings.cs | 12 +++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Tests/Orso.Arpa.Tests.Shared/FakeData/FakeMusicianProfiles.cs b/Tests/Orso.Arpa.Tests.Shared/FakeData/FakeMusicianProfiles.cs index 2a6b94c12..3688fc309 100644 --- a/Tests/Orso.Arpa.Tests.Shared/FakeData/FakeMusicianProfiles.cs +++ b/Tests/Orso.Arpa.Tests.Shared/FakeData/FakeMusicianProfiles.cs @@ -41,8 +41,9 @@ public static MusicianProfile PerformerHornMusicianProfile universityEducation.SetProperty(nameof(Education.Type), FakeSelectValueMappings.PrivateLesson); profile.Educations.Add(universityEducation); CurriculumVitaeReference mozarteum = CurriculumVitaeReferenceSeedData.Mozarteum; - mozarteum.SetProperty(nameof(MusicianProfile.CreatedBy), "anonymous"); - mozarteum.SetProperty(nameof(MusicianProfile.CreatedAt), FakeDateTime.UtcNow); + mozarteum.SetProperty(nameof(CurriculumVitaeReference.CreatedBy), "anonymous"); + mozarteum.SetProperty(nameof(CurriculumVitaeReference.CreatedAt), FakeDateTime.UtcNow); + mozarteum.SetProperty(nameof(CurriculumVitaeReference.Type), FakeSelectValueMappings.EnsemblePosition); profile.CurriculumVitaeReferences.Add(mozarteum); return profile; } diff --git a/Tests/Orso.Arpa.Tests.Shared/FakeData/FakeSelectValueMappings.cs b/Tests/Orso.Arpa.Tests.Shared/FakeData/FakeSelectValueMappings.cs index 61bf41246..744e249d8 100644 --- a/Tests/Orso.Arpa.Tests.Shared/FakeData/FakeSelectValueMappings.cs +++ b/Tests/Orso.Arpa.Tests.Shared/FakeData/FakeSelectValueMappings.cs @@ -106,7 +106,7 @@ public static SelectValueMapping PrivateOwnership } } - public static SelectValueMapping PrivateLesson + public static SelectValueMapping PrivateLesson { get { @@ -115,5 +115,15 @@ public static SelectValueMapping PrivateLesson return selectValueMapping; } } + + public static SelectValueMapping EnsemblePosition + { + get + { + SelectValueMapping selectValueMapping = SelectValueMappingSeedData.CurriculumVitaeReferenceTypeMappings[0]; + selectValueMapping.SetProperty(nameof(SelectValueMapping.SelectValue), SelectValueSeedData.EnsemblePosition); + return selectValueMapping; + } + } } }