private static void AssertParticipantsCount(IList <ParticipantResponse> participantResponses, HearingRow rowData) { var participantsCount = participantResponses.Count(x => x.HearingRoleName == "Individual" || x.HearingRoleName == "Representative" || x.HearingRoleName == "Litigant in person"); if (participantsCount > 0) { var participantEnding = participantsCount > 1 ? "s" : ""; var participantsCountText = $"{participantsCount} Participant{participantEnding}"; rowData.ParticipantCount.Should().Be(participantsCountText); } var panelMembersCount = participantResponses.Count(x => x.HearingRoleName == "Panel Member"); if (panelMembersCount > 0) { var panelMembersEnding = panelMembersCount > 1 ? "s" : ""; var panelMembersCountText = $"{panelMembersCount} Panel Member{panelMembersEnding}"; rowData.PanelMembersCount.Should().Be(panelMembersCountText); } var observersCount = participantResponses.Count(x => x.HearingRoleName == "Observer"); if (observersCount > 0) { var observersEnding = observersCount > 1 ? "s" : ""; var observersCountText = $"{observersCount} Observer{observersEnding}"; rowData.ObserversCount.Should().Be(observersCountText); } var wingersCount = participantResponses.Count(x => x.HearingRoleName == "Winger"); if (wingersCount > 0) { var wingersEnding = wingersCount > 1 ? "s" : ""; var wingersCountText = $"{wingersCount} Winger{wingersEnding}"; rowData.WingersCount.Should().Be(wingersCountText); } }
private static void ParticipantsDisplayed(IEnumerable <ParticipantResponse> participants, HearingRow rowData) { var participantResponses = participants.ToList(); AssertParticipantsCount(participantResponses, rowData); }