Пример #1
0
        public async Task StartPrivateConsultationAsync(Conference conference, Participant requestedBy,
                                                        Participant requestedFor)
        {
            var targetRoom = _roomReservationService.GetNextAvailableConsultationRoom(conference);

            _logger.LogInformation(
                "Conference: {conference.Id} - Attempting to transfer participants {requestedBy.Id} {requestedFor.Id} into room {targetRoom}",
                conference.Id, requestedBy.Id, requestedFor.Id, targetRoom);

            await TransferParticipantAsync(conference.Id, requestedBy.Id,
                                           requestedBy.GetCurrentRoom(), targetRoom);

            await TransferParticipantAsync(conference.Id, requestedFor.Id,
                                           requestedFor.GetCurrentRoom(), targetRoom);
        }
Пример #2
0
        public void Should_throw_exception_when_no_hearing_room_available()
        {
            // make sure no rooms are available
            _testConference.Participants[1].UpdateCurrentRoom(RoomType.ConsultationRoom1);
            _testConference.Participants[2].UpdateCurrentRoom(RoomType.ConsultationRoom2);

            Action action = () => _roomReservationService.GetNextAvailableConsultationRoom(_testConference);

            action.Should().Throw <DomainRuleException>().And.ValidationFailures.Any(x => x.Name == "Unavailable room")
            .Should().BeTrue();
        }