Esempio n. 1
0
        public async Task Should_Successfully_Transfer_Participant_To_ConsultationRoom()
        {
            _queryHandler.Setup(x => x.Handle <GetConferenceByIdQuery, Conference>(It.IsAny <GetConferenceByIdQuery>()))
            .ReturnsAsync(TestConference);

            var room        = _rooms.First(x => x.ConferenceId.Equals(_request.ConferenceId));
            var participant =
                TestConference.Participants.First(x => x.Id.Equals(_request.RequestedBy));
            await _consultationService.ParticipantTransferToRoomAsync(_request.ConferenceId, _request.RequestedBy,
                                                                      room.Label);

            var request = new TransferParticipantParams
            {
                From    = participant.GetCurrentRoom(),
                To      = room.Label,
                Part_id = participant.Id.ToString()
            };

            _kinlyApiClient.Verify(x => x.TransferParticipantAsync(It.Is <string>(
                                                                       y => y.Equals(_request.ConferenceId.ToString())), It.Is <TransferParticipantParams>(
                                                                       y => y.From.Equals(request.From) && y.To.Equals(request.To) && y.Part_id.Equals(request.Part_id))),
                                   Times.Once);
        }