public void ThenTheParticipantsStatusesShouldUpdateTo(string text, string expectedStatus) { _browsers[_c.CurrentUser].Refresh(); Scrolling.ScrollToTheHearing(_browsers[_c.CurrentUser], _c.Test.Conference.Id); _browsers[_c.CurrentUser].Click(VhoHearingListPage.SelectHearingButton(_c.Test.Conference.Id)); Scrolling.ScrollToTheTopOfThePage(_browsers[_c.CurrentUser]); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(AdminPanelPage.ParticipantStatusTable, 60).Displayed.Should().BeTrue(); var participants = text.Equals("participants") ? _c.Test.ConferenceParticipants.Where(x => x.UserRole != UserRole.Judge) : ParticipantsManager.GetParticipantsFromRole(_c.Test.ConferenceParticipants, text); CheckParticipantStatus(expectedStatus, participants); }
public void WhenTheParticipantsStatusesChange(string text, string action) { var statuses = new Dictionary <string, IParticipantStatusStrategy> { { "Available", new AvailableStrategy() }, { "Disconnected", new DisconnectedStrategy() }, { "In consultation", new InConsultationStrategy() }, { "In hearing", new InHearingStrategy() }, { "Joining", new JoiningStrategy() } }; var participants = text.Equals("participants") ? _c.Test.ConferenceParticipants.Where(x => x.UserRole != UserRole.Judge) : ParticipantsManager.GetParticipantsFromRole(_c.Test.ConferenceParticipants, text); foreach (var participant in participants) { statuses[action].Execute(_c, participant.Id); } }