Ejemplo n.º 1
0
        public void Setup()
        {
            _queryHandler          = new Mock <IQueryHandler>();
            _audioPlatformService  = new Mock <IAudioPlatformService>();
            _storageServiceFactory = new Mock <IAzureStorageServiceFactory>();
            _storageService        = new Mock <IAzureStorageService>();

            _controller = new AudioRecordingController
                          (
                _storageServiceFactory.Object, _audioPlatformService.Object,
                new Mock <ILogger <AudioRecordingController> >().Object, _queryHandler.Object
                          );


            _testConference = new ConferenceBuilder()
                              .WithParticipant(UserRole.Judge, null)
                              .WithParticipant(UserRole.Individual, "Claimant", null, null, RoomType.ConsultationRoom1)
                              .WithParticipant(UserRole.Representative, "Claimant")
                              .WithParticipant(UserRole.Individual, "Defendant")
                              .WithParticipant(UserRole.Representative, "Defendant")
                              .Build();

            _queryHandler
            .Setup(x =>
                   x.Handle <GetConferenceByHearingRefIdQuery, VideoApi.Domain.Conference>(
                       It.IsAny <GetConferenceByHearingRefIdQuery>()))
            .ReturnsAsync(_testConference);
        }
Ejemplo n.º 2
0
        public void Setup()
        {
            QueryHandlerMock        = new Mock <IQueryHandler>();
            CommandHandlerMock      = new Mock <ICommandHandler>();
            MockLogger              = new Mock <ILogger <ConsultationController> >();
            ConsultationServiceMock = new Mock <IConsultationService>();

            TestConference = new ConferenceBuilder()
                             .WithParticipant(UserRole.Judge, null)
                             .WithParticipant(UserRole.Individual, "Applicant", null, null, RoomType.ConsultationRoom)
                             .WithParticipant(UserRole.Representative, "Applicant", "*****@*****.**")
                             .WithParticipant(UserRole.Individual, "Respondent")
                             .WithParticipant(UserRole.Representative, "Respondent")
                             .WithEndpoint("Endpoint With DA", $"{Guid.NewGuid():N}@hmcts.net", "*****@*****.**")
                             .WithEndpoint("Endpoint Without DA", $"{Guid.NewGuid():N}@hmcts.net")
                             .Build();

            QueryHandlerMock
            .Setup(x => x.Handle <GetConferenceByIdQuery, VideoApi.Domain.Conference>(
                       It.Is <GetConferenceByIdQuery>(q => q.ConferenceId == TestConference.Id)))
            .ReturnsAsync(TestConference);

            CommandHandlerMock
            .Setup(x => x.Handle(It.IsAny <SaveEventCommand>()))
            .Returns(Task.FromResult(default(object)));

            Controller = new ConsultationController(QueryHandlerMock.Object,
                                                    MockLogger.Object, ConsultationServiceMock.Object, CommandHandlerMock.Object);
        }
        public void Setup()
        {
            MockQueryHandler         = new Mock <IQueryHandler>();
            MockCommandHandler       = new Mock <ICommandHandler>();
            MockVideoPlatformService = new Mock <IVideoPlatformService>();
            _mockLogger = new Mock <ILogger <ParticipantsController> >();

            TestConference = new ConferenceBuilder()
                             .WithParticipant(UserRole.Judge, null)
                             .WithParticipant(UserRole.Individual, "Claimant", null, null, RoomType.ConsultationRoom1)
                             .WithParticipant(UserRole.Representative, "Claimant")
                             .WithParticipant(UserRole.Individual, "Defendant")
                             .WithParticipant(UserRole.Representative, "Defendant")
                             .Build();

            Controller = new ParticipantsController(MockCommandHandler.Object, MockQueryHandler.Object,
                                                    MockVideoPlatformService.Object, _mockLogger.Object);
        }
        public void Setup()
        {
            TestConference = new ConferenceBuilder()
                             .WithParticipant(UserRole.Judge, null)
                             .WithParticipant(UserRole.Individual, "Applicant", null, null, RoomType.ConsultationRoom)
                             .WithParticipant(UserRole.Representative, "Applicant", "*****@*****.**")
                             .WithParticipant(UserRole.Individual, "Respondent")
                             .WithParticipant(UserRole.Representative, "Respondent")
                             .WithEndpoint("Endpoint With DA", $"{Guid.NewGuid():N}@hmcts.net", "*****@*****.**")
                             .WithEndpoint("Endpoint Without DA", $"{Guid.NewGuid():N}@hmcts.net")
                             .Build();
            Mocker     = AutoMock.GetLoose();
            MockLogger = Mocker.Mock <ILogger <ConferenceManagementController> >();

            UpdateConferenceQueryMock();
            VideoPlatformServiceMock = Mocker.Mock <IVideoPlatformService>();

            Controller = Mocker.Create <ConferenceManagementController>();
        }
        protected void SetupTestConference()
        {
            QueryHandlerMock   = new Mock <IQueryHandler>();
            CommandHandlerMock = new Mock <ICommandHandler>();

            TestConference = new ConferenceBuilder()
                             .WithParticipant(UserRole.Judge, null)
                             .WithParticipant(UserRole.Individual, "Applicant", null, null, RoomType.ConsultationRoom)
                             .WithParticipant(UserRole.Representative, "Applicant", "*****@*****.**")
                             .WithParticipant(UserRole.Individual, "Respondent")
                             .WithParticipant(UserRole.Representative, "Respondent")
                             .WithEndpoint("Endpoint With DA", $"{Guid.NewGuid():N}@hmcts.net", "*****@*****.**")
                             .WithEndpoint("Endpoint Without DA", $"{Guid.NewGuid():N}@hmcts.net")
                             .Build();

            QueryHandlerMock
            .Setup(x => x.Handle <GetConferenceByIdQuery, VideoApi.Domain.Conference>(
                       It.Is <GetConferenceByIdQuery>(q => q.ConferenceId == TestConference.Id)))
            .ReturnsAsync(TestConference);
        }