public void Setup() { _userApiClient = new Mock <IUserApiClient>(); _bookingsApiClient = new Mock <IBookingsApiClient>(); _userIdentity = new Mock <IUserIdentity>(); _userAccountServiceLogger = new Mock <ILogger <UserAccountService> >(); _notificationApiMock = new Mock <INotificationApiClient>(); _userAccountService = new UserAccountService(_userApiClient.Object, _bookingsApiClient.Object, _notificationApiMock.Object, _userAccountServiceLogger.Object); _editHearingRequestValidator = new Mock <IValidator <EditHearingRequest> >(); _videoApiMock = new Mock <IVideoApiClient>(); _pollyRetryServiceMock = new Mock <IPollyRetryService>(); _participantGroupLogger = new Mock <ILogger <HearingsService> >(); _hearingsService = new HearingsService(_pollyRetryServiceMock.Object, _userAccountService, _notificationApiMock.Object, _videoApiMock.Object, _bookingsApiClient.Object, _participantGroupLogger.Object); _controller = new AdminWebsite.Controllers.HearingsController(_bookingsApiClient.Object, _userIdentity.Object, _userAccountService, _editHearingRequestValidator.Object, new Mock <ILogger <AdminWebsite.Controllers.HearingsController> >().Object, _hearingsService, Mock.Of <IPublicHolidayRetriever>()); InitHearingForTest(); }
public void Setup() { _bookingsApiClient = new Mock <IBookingsApiClient>(); _userIdentity = new Mock <IUserIdentity>(); _userAccountService = new Mock <IUserAccountService>(); _editHearingRequestValidator = new Mock <IValidator <EditHearingRequest> >(); _videoApiMock = new Mock <IVideoApiClient>(); _pollyRetryServiceMock = new Mock <IPollyRetryService>(); _notificationApiMock = new Mock <INotificationApiClient>(); _participantGroupLogger = new Mock <ILogger <HearingsService> >(); _hearingsService = new HearingsService(_pollyRetryServiceMock.Object, _userAccountService.Object, _notificationApiMock.Object, _videoApiMock.Object, _bookingsApiClient.Object, _participantGroupLogger.Object); _controller = new AdminWebsite.Controllers.HearingsController(_bookingsApiClient.Object, _userIdentity.Object, _userAccountService.Object, _editHearingRequestValidator.Object, new Mock <ILogger <AdminWebsite.Controllers.HearingsController> >().Object, _hearingsService, Mock.Of <IPublicHolidayRetriever>()); _guid = Guid.NewGuid(); _updateBookingStatusRequest = new UpdateBookingStatusRequest() { Status = UpdateBookingStatus.Cancelled, UpdatedBy = "admin user" }; }
public void Setup() { _bookingsApiClient = new Mock <IBookingsApiClient>(); _userIdentity = new Mock <IUserIdentity>(); _userAccountService = new Mock <IUserAccountService>(); _editHearingRequestValidator = new Mock <IValidator <EditHearingRequest> >(); _videoApiMock = new Mock <IVideoApiClient>(); _notificationApiMock = new Mock <INotificationApiClient>(); _pollyRetryServiceMock = new Mock <IPollyRetryService>(); _participantGroupLogger = new Mock <ILogger <HearingsService> >(); _hearingsService = new HearingsService(_pollyRetryServiceMock.Object, _userAccountService.Object, _notificationApiMock.Object, _videoApiMock.Object, _bookingsApiClient.Object, _participantGroupLogger.Object); _controller = new AdminWebsite.Controllers.HearingsController(_bookingsApiClient.Object, _userIdentity.Object, _userAccountService.Object, _editHearingRequestValidator.Object, new Mock <ILogger <AdminWebsite.Controllers.HearingsController> >().Object, _hearingsService, Mock.Of <IPublicHolidayRetriever>()); _userAccountService .Setup(x => x.UpdateParticipantUsername(It.IsAny <BookingsApi.Contract.Requests.ParticipantRequest>())) .Callback <BookingsApi.Contract.Requests.ParticipantRequest>(p => { p.Username ??= p.ContactEmail; }) .ReturnsAsync(new User()); }
public void Setup() { _bookingsApiClient = new Mock <IBookingsApiClient>(); _userIdentity = new Mock <IUserIdentity>(); _userAccountService = new Mock <IUserAccountService>(); _editHearingRequestValidator = new Mock <IValidator <EditHearingRequest> >(); _videoApiMock = new Mock <IVideoApiClient>(); _pollyRetryServiceMock = new Mock <IPollyRetryService>(); _notificationApiMock = new Mock <INotificationApiClient>(); _participantGroupLogger = new Mock <ILogger <HearingsService> >(); _hearingsService = new HearingsService(_pollyRetryServiceMock.Object, _userAccountService.Object, _notificationApiMock.Object, _videoApiMock.Object, _bookingsApiClient.Object, _participantGroupLogger.Object); _controller = new AdminWebsite.Controllers.HearingsController(_bookingsApiClient.Object, _userIdentity.Object, _userAccountService.Object, _editHearingRequestValidator.Object, new Mock <ILogger <AdminWebsite.Controllers.HearingsController> >().Object, _hearingsService, Mock.Of <IPublicHolidayRetriever>()); _conference = new ConferenceDetailsResponse { MeetingRoom = new MeetingRoomResponse { TelephoneConferenceId = "454545", AdminUri = "uri", JudgeUri = "uri", ParticipantUri = "uri", PexipNode = "node" } }; }
public void Setup() { _bookingsApiClient = new Mock <IBookingsApiClient>(); _userIdentity = new Mock <IUserIdentity>(); _userAccountService = new Mock <IUserAccountService>(); _editHearingRequestValidator = new Mock <IValidator <EditHearingRequest> >(); _videoApiMock = new Mock <IVideoApiClient>(); _pollyRetryServiceMock = new Mock <IPollyRetryService>(); _notificationApiMock = new Mock <INotificationApiClient>(); _participantGroupLogger = new Mock <ILogger <HearingsService> >(); _hearingsService = new HearingsService(_pollyRetryServiceMock.Object, _userAccountService.Object, _notificationApiMock.Object, _videoApiMock.Object, _bookingsApiClient.Object, _participantGroupLogger.Object); _controller = new AdminWebsite.Controllers.HearingsController(_bookingsApiClient.Object, _userIdentity.Object, _userAccountService.Object, _editHearingRequestValidator.Object, new Mock <ILogger <AdminWebsite.Controllers.HearingsController> >().Object, _hearingsService, Mock.Of <IPublicHolidayRetriever>()); _vhExistingHearing = new HearingDetailsResponse { Cases = new List <BookingsApi.Contract.Responses.CaseResponse>() { new BookingsApi.Contract.Responses.CaseResponse { Name = "BBC vs ITV", Number = "TX/12345/2019", IsLeadCase = false } }, CaseTypeName = "Generic", CreatedBy = "CaseAdministrator", CreatedDate = DateTime.UtcNow, HearingRoomName = "Room 6.41D", HearingTypeName = "Automated Test", HearingVenueName = "Manchester Civil and Family Justice Centre", Id = _guid, OtherInformation = "Any other information about the hearing", Participants = new List <ParticipantResponse>() { new ParticipantResponse() { CaseRoleName = "Judge", ContactEmail = "*****@*****.**", DisplayName = "Judge Lumb", FirstName = "Judge", HearingRoleName = "Judge", LastName = "Lumb", MiddleNames = string.Empty, TelephoneNumber = string.Empty, Title = "Judge", Username = "******" }, new ParticipantResponse() { CaseRoleName = "Applicant", ContactEmail = "*****@*****.**", DisplayName = "Test Applicant", FirstName = "Test", HearingRoleName = "Litigant in person", LastName = "Applicant", MiddleNames = string.Empty, TelephoneNumber = string.Empty, Title = "Mr", Username = "******" }, new ParticipantResponse() { CaseRoleName = "Respondent", ContactEmail = "*****@*****.**", DisplayName = "Test Respondent", FirstName = "Test", HearingRoleName = "Representative", LastName = "Respondent", MiddleNames = string.Empty, TelephoneNumber = string.Empty, Title = "Mr", Username = "******" }, }, ScheduledDateTime = DateTime.UtcNow.AddDays(10), ScheduledDuration = 60, Status = BookingStatus.Booked, UpdatedBy = string.Empty, UpdatedDate = DateTime.UtcNow }; _bookingsApiClient.Setup(x => x.GetHearingDetailsByIdAsync(It.IsAny <Guid>())) .ReturnsAsync(_vhExistingHearing); }