public void Arrange() { var mediator = new Mock <IMediator>(); MappingBootstrapper.Initialize(); var certificateHistoryResponses = Builder <CertificateSummaryResponse> .CreateListOfSize(10).Build().ToList(); var certificateHistoryPaginatedList = new PaginatedList <CertificateSummaryResponse>(certificateHistoryResponses, 40, 1, 10); mediator.Setup(q => q.Send(Moq.It.IsAny <GetCertificateHistoryRequest>(), new CancellationToken())) .Returns(Task.FromResult((certificateHistoryPaginatedList))); var certificateQueryControler = new CertificateQueryController(mediator.Object); var statuses = new List <string> { "Submitted" }; int page = 1; string userName = "******"; string searchTerm = "test"; string sortColumn = "DateRequested"; int sortDescending = 1; _result = certificateQueryControler.GetCertificatesHistory(page, userName, searchTerm, sortColumn, sortDescending).Result; }
public void Arrange() { var mediator = new Mock <IMediator>(); MappingBootstrapper.Initialize(); var certificateResponses = Builder <CertificateResponse> .CreateListOfSize(10).Build().ToList(); mediator.Setup(q => q.Send(Moq.It.IsAny <GetToBePrintedCertificatesRequest>(), new CancellationToken())) .Returns(Task.FromResult((certificateResponses))); var certificateQueryControler = new CertificateQueryController(mediator.Object); _result = certificateQueryControler.GetCertificatesToBePrinted().Result; }