public async Task Should_return_ok_result_for_given_conference_id_and_participants()
        {
            MockQueryHandler
            .Setup(x => x.Handle <GetConferenceByIdQuery, VideoApi.Domain.Conference>(It.IsAny <GetConferenceByIdQuery>()))
            .ReturnsAsync(TestConference);

            var result = await Controller.GetParticipantsByConferenceId(TestConference.Id);

            var typedResult = (OkObjectResult)result;

            typedResult.StatusCode.Should().Be((int)HttpStatusCode.OK);
            var participantsSummary = (List <ParticipantSummaryResponse>)typedResult.Value;

            participantsSummary.Count.Should().Be(5);

            var participant          = participantsSummary[1];
            var exspectedParticipant = TestConference.Participants[1];

            participant.CaseGroup.Should().Be(exspectedParticipant.CaseTypeGroup);
            participant.Id.Should().Be(exspectedParticipant.Id);
            participant.Username.Should().Be(exspectedParticipant.Username);
            participant.DisplayName.Should().Be(exspectedParticipant.DisplayName);
            participant.FirstName.Should().Be(exspectedParticipant.FirstName);
            participant.LastName.Should().Be(exspectedParticipant.LastName);
            participant.Status.Should().Be(exspectedParticipant.State);
            participant.UserRole.Should().Be(exspectedParticipant.UserRole);
            participant.HearingRole.Should().Be(exspectedParticipant.HearingRole);
            participant.Representee.Should().Be(exspectedParticipant.Representee);
            participant.ContactEmail.Should().Be(exspectedParticipant.ContactEmail);
            participant.ContactTelephone.Should().Be(exspectedParticipant.ContactTelephone);
        }
        public void TestInitialize()
        {
            var judgeFirstnames = new List <string> {
                "JudgeName1", "JudgeName2", "JudgeName3"
            };

            MockQueryHandler
            .Setup(x => x.Handle <GetDistinctJudgeListByFirstNameQuery, List <string> >(It.IsAny <GetDistinctJudgeListByFirstNameQuery>()))
            .ReturnsAsync(judgeFirstnames);
        }
        public async Task Should_return_notfound_with_no_matching_conference()
        {
            MockQueryHandler
            .Setup(x => x.Handle <GetConferenceByIdQuery, VideoApi.Domain.Conference>(It.IsAny <GetConferenceByIdQuery>()))
            .ReturnsAsync((VideoApi.Domain.Conference)null);

            var result = await Controller.RemoveParticipantFromConferenceAsync(Guid.NewGuid(), Guid.NewGuid());

            var typedResult = (NotFoundResult)result;

            typedResult.Should().NotBeNull();
        }
示例#4
0
        public async Task Should_return_badrequest_when_request_is_null()
        {
            MockQueryHandler
            .Setup(x => x.Handle <GetConferenceByIdQuery, VideoApi.Domain.Conference>(It.IsAny <GetConferenceByIdQuery>()))
            .ReturnsAsync((VideoApi.Domain.Conference)null);

            var result = await Controller.SaveHeartbeatDataForParticipantAsync(Guid.Empty, Guid.Empty, null);

            var typedResult = (BadRequestResult)result;

            typedResult.Should().NotBeNull();
        }
        public void TestInitialize()
        {
            _updateParticipantRequest = new UpdateParticipantRequest
            {
                Fullname    = "Test Name",
                DisplayName = "Test N",
                Representee = "Represent"
            };

            MockQueryHandler
            .Setup(x =>
                   x.Handle <GetConferenceByIdQuery, VideoApi.Domain.Conference>(It.IsAny <GetConferenceByIdQuery>()))
            .ReturnsAsync(TestConference);
        }
示例#6
0
        public void TestInitialize()
        {
            MockQueryHandler
            .Setup(x => x.Handle <GetConferenceByIdQuery, VideoApi.Domain.Conference>(It.IsAny <GetConferenceByIdQuery>()))
            .ReturnsAsync(TestConference);

            var heartbeats = new List <Heartbeat>
            {
                new Heartbeat(TestConference.Id, TestConference.Participants.First().Id, 1, 2, 3, 4, 5, 6, 7, 8,
                              DateTime.MaxValue, "chrome", "1", "Mac OS X", "10.15.7")
            };

            MockQueryHandler
            .Setup(x => x.Handle <GetHeartbeatsFromTimePointQuery, IList <Heartbeat> >(It.IsAny <GetHeartbeatsFromTimePointQuery>()))
            .ReturnsAsync(heartbeats);
        }
 public void TestInitialize()
 {
     MockQueryHandler
     .Setup(x => x.Handle <GetConferenceByIdQuery, VideoApi.Domain.Conference>(It.IsAny <GetConferenceByIdQuery>()))
     .ReturnsAsync(TestConference);
 }