public async Task Should_remove_given_participants_from_conference()
        {
            var conferenceId = TestConference.Id;
            var participant  = TestConference.GetParticipants()[1];

            await Controller.RemoveParticipantFromConferenceAsync(conferenceId, participant.Id);

            MockQueryHandler.Verify(m => m.Handle <GetConferenceByIdQuery, VideoApi.Domain.Conference>(It.IsAny <GetConferenceByIdQuery>()), Times.Once);
            MockCommandHandler.Verify(c =>
                                      c.Handle(It.Is <RemoveParticipantsFromConferenceCommand>(x => x.Participants[0].Id == participant.Id)), Times.Once);
        }
        public async Task Should_get_judge_list_response()
        {
            var result = await Controller.GetDistinctJudgeNamesAsync();

            MockQueryHandler.Verify(m => m.Handle <GetDistinctJudgeListByFirstNameQuery, List <string> >(It.IsAny <GetDistinctJudgeListByFirstNameQuery>()), Times.Once);

            result.Should().NotBeNull();
            result.Should().BeAssignableTo <OkObjectResult>();
            var response = result.As <OkObjectResult>().Value.As <JudgeNameListResponse>();

            response.FirstNames.Count.Should().Be(3);
        }
Exemple #3
0
        public async Task Should_get_heartbeatResponses()
        {
            var conferenceId  = TestConference.Id;
            var participantId = TestConference.GetParticipants()[1].Id;


            var result = await Controller.GetHeartbeatDataForParticipantAsync(conferenceId, participantId);

            MockQueryHandler.Verify(m => m.Handle <GetHeartbeatsFromTimePointQuery, IList <Heartbeat> >(It.IsAny <GetHeartbeatsFromTimePointQuery>()), Times.Once);

            result.Should().NotBeNull();
            result.Should().BeAssignableTo <OkObjectResult>();
            var responses = result.As <OkObjectResult>().Value.As <IEnumerable <ParticipantHeartbeatResponse> >().ToList();

            responses.Should().NotBeNull().And.NotBeEmpty().And.NotContainNulls();
            var heartbeatResponse = responses.First().As <ParticipantHeartbeatResponse>();

            heartbeatResponse.BrowserName.Should().Be("chrome");
            heartbeatResponse.BrowserVersion.Should().Be("1");
            heartbeatResponse.RecentPacketLoss.Should().Be(8);
            heartbeatResponse.OperatingSystem.Should().Be("Mac OS X");
            heartbeatResponse.OperatingSystemVersion.Should().Be("10.15.7");
        }