public void When_Mapping_EdFiPostSecondaryInstitution_to_PostSecondaryInstitution_Should_Have_Expected_Values_On_Destination() { // Arrange var edfiPsi = new EdFiPostSecondaryInstitution(Id, _addresses, _edOrgCategories, postSecondaryInstitutionLevelDescriptor: PostSecondaryInstitutionLevel, administrativeFundingControlDescriptor: AdministrativeFundingControl, nameOfInstitution: Name, postSecondaryInstitutionId: PsiId); // Act var result = _mapper.Map <PostSecondaryInstitution>(edfiPsi); // Assert result.ShouldNotBeNull(); result.Id.ShouldBe(Id); result.Name.ShouldBe(Name); result.EducationOrganizationId.ShouldBe(PsiId); result.PostSecondaryInstitutionId.ShouldBe(PsiId); result.StreetNumberName.ShouldBe(StreetNumberName); result.ApartmentRoomSuiteNumber.ShouldBe(ApartmentRoomSuiteNumber); result.State.ShouldBe(StateAbbreviationDescriptor); result.City.ShouldBe(City); result.ZipCode.ShouldBe(PostalCode); result.PostSecondaryInstitutionLevel.ShouldBe(PostSecondaryInstitutionLevel); result.AdministrativeFundingControl.ShouldBe(AdministrativeFundingControl); }
public List <EdFiEducationOrganizationAddress> Resolve(PostSecondaryInstitution source, EdFiPostSecondaryInstitution destination, List <EdFiEducationOrganizationAddress> destMember, ResolutionContext context) { var addressList = EducationOrganizationAddressResolver.ReplaceFirstAddressInList(source, destMember); destMember?.Clear(); // by default, automapper combines the source list with the destination list. we want to replace the destination list instead return(addressList); }
public List <EdFiEducationOrganizationCategory> Resolve(PostSecondaryInstitution source, EdFiPostSecondaryInstitution destination, List <EdFiEducationOrganizationCategory> destMember, ResolutionContext context) { destMember?.Clear(); // by default, automapper combines the source list with the destination list. we want to replace the destination list instead return(EducationOrganizationCategoryResolver.GetNewEducationCategory(source.EducationOrganizationCategory)); }