Skip to content

Commit

Permalink
VIH-10965 map audio playback language. Default to not welsh
Browse files Browse the repository at this point in the history
  • Loading branch information
shaed-parkar committed Dec 13, 2024
1 parent 9841008 commit 8659864
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public static BookNewConferenceRequest MapToBookNewConferenceRequest(HearingDto
Endpoints = PopulateAddEndpointRequests(endpointDtos, participantDtos).ToList(),
CaseTypeServiceId = hearingDto.CaseTypeServiceId,
Supplier = (Supplier)hearingDto.VideoSupplier,
ConferenceRoomType = (ConferenceRoomType)hearingDto.ConferenceRoomType
ConferenceRoomType = (ConferenceRoomType)hearingDto.ConferenceRoomType,
AudioPlaybackLanguage = hearingDto.IsVenueWelsh ? AudioPlaybackLanguage.EnglishAndWelsh : AudioPlaybackLanguage.English
};

return request;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public class HearingDto
public string CaseTypeServiceId { get; set; }
public VideoSupplier VideoSupplier { get; set; }
public ConferenceRoomType ConferenceRoomType { get; set; }

public bool IsVenueWelsh { get; set; } = false;

public bool IsMultiDayHearing() => GroupId.HasValue && GroupId.GetValueOrDefault() != Guid.Empty;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public void should_map_hearing_dto_to_book_new_conference_request()
.Excluding(o => o.HearingId).ExcludingMissingMembers()
);
request.AudioRecordingRequired.Should().Be(hearingDto.RecordAudio);
request.AudioPlaybackLanguage.Should().Be(AudioPlaybackLanguage.English);
request.HearingRefId.Should().Be(hearingDto.HearingId);
request.Participants.Count.Should().Be(participants.Count);
request.Endpoints.Count.Should().Be(endpoints.Count);
Expand All @@ -39,6 +40,18 @@ public void should_map_hearing_dto_to_book_new_conference_request()
thirdEndpoint.ConferenceRole.Should().Be(ConferenceRole.Guest);
}

[Test]
public void should_map_iswelsh_to_english_and_welsh_playback_language()
{
var hearingDto = CreateHearingDto();
hearingDto.IsVenueWelsh = true;

var request = HearingToBookConferenceMapper
.MapToBookNewConferenceRequest(hearingDto, new List<ParticipantDto>(), new List<EndpointDto>());

request.AudioPlaybackLanguage.Should().Be(AudioPlaybackLanguage.EnglishAndWelsh);
}

private static HearingDto CreateHearingDto()
{
var dto = new HearingDto
Expand All @@ -51,8 +64,9 @@ private static HearingDto CreateHearingDto()
ScheduledDateTime = DateTime.UtcNow,
HearingVenueName = "MyVenue",
RecordAudio = true,
CaseTypeServiceId = "ZZY1",
VideoSupplier = VideoSupplier.Kinly
CaseTypeServiceId ="ZZY1",
VideoSupplier = VideoSupplier.Vodafone,
IsVenueWelsh = false
};
return dto;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private static HearingIsReadyForVideoIntegrationEvent CreateEvent(bool isMultiHe
HearingVenueName = "MyVenue",
RecordAudio = true,
GroupId = isMultiHearing ? Guid.NewGuid() : null,
VideoSupplier = VideoSupplier.Kinly
VideoSupplier = VideoSupplier.Vodafone
};
var participants = Builder<ParticipantDto>.CreateListOfSize(4)
.All().With(x => x.UserRole = UserRole.Individual.ToString()).Build().ToList();
Expand Down

0 comments on commit 8659864

Please sign in to comment.