private async Task <ParticipantRoom> GetUpdatedRoom(Conference conference, long roomId)
        {
            var query       = new GetParticipantRoomsForConferenceQuery(conference.Id);
            var listOfRooms =
                await _queryHandler.Handle <GetParticipantRoomsForConferenceQuery, List <ParticipantRoom> >(query);

            return(listOfRooms.First(x => x.Id == roomId));
        }
Ejemplo n.º 2
0
        public async Task Should_return_an_empty_list_if_conference_does_not_exist()
        {
            var fakeConferenceId = Guid.NewGuid();
            var query            = new GetParticipantRoomsForConferenceQuery(fakeConferenceId);
            var result           = await _handler.Handle(query);

            result.Should().BeEmpty();
        }
        private async Task <ParticipantRoom> RetrieveJudicialRoomForConference(Guid conferenceId)
        {
            var participantRoomsQuery =
                new GetParticipantRoomsForConferenceQuery(conferenceId);

            var interpreterRooms =
                await _queryHandler.Handle <GetParticipantRoomsForConferenceQuery, List <ParticipantRoom> >(
                    participantRoomsQuery);

            return(interpreterRooms.FirstOrDefault(x => x.Type == VirtualCourtRoomType.JudicialShared));
        }
        private async Task <IReadOnlyCollection <ParticipantRoom> > RetrieveAllInterpreterRooms(Guid conferenceId)
        {
            var participantRoomsQuery =
                new GetParticipantRoomsForConferenceQuery(conferenceId);

            var interpreterRooms =
                await _queryHandler.Handle <GetParticipantRoomsForConferenceQuery, List <ParticipantRoom> >(
                    participantRoomsQuery);

            return(interpreterRooms.Where(x => x.Label.StartsWith(InterpreterRoomPrefix)).ToList().AsReadOnly());
        }
Ejemplo n.º 5
0
        public async Task should_return_list_of_interpreter_rooms_for_conference()
        {
            var conference = await TestDataManager.SeedConference();

            _newConferenceId = conference.Id;
            _rooms           = CreateRoomsForConference(conference.Id);
            await TestDataManager.SeedRooms(_rooms);

            var interpreterRooms = _rooms.Where(r => r is ParticipantRoom).ToList();

            var query  = new GetParticipantRoomsForConferenceQuery(conference.Id);
            var result = await _handler.Handle(query);


            result.Count.Should().Be(interpreterRooms.Count);
            result.Select(r => r.Id).Should().Contain(interpreterRooms.Select(r => r.Id));
        }