public void Setup() { _mediator = new Mock <IMediator>(); _employerAccountsApiService = new Mock <IEmployerAccountsApiService>(); _response = new GetFinancialStatisticsResponse { TotalPayments = 5 }; _mediator.Setup(m => m.SendAsync(It.IsAny <GetFinancialStatisticsQuery>())).ReturnsAsync(_response); _statistics = new Statistics { TotalAccounts = 1, TotalAgreements = 2, TotalLegalEntities = 3, TotalPayeSchemes = 4 }; _employerAccountsApiService.Setup( s => s.GetStatistics(It.IsAny <CancellationToken>())) .ReturnsAsync(_statistics); _orchestrator = new StatisticsOrchestrator(_mediator.Object, _employerAccountsApiService.Object); }
public void Setup() { _mockMediator = new Mock <IMediator>(); _statisticsMapper = new Mock <IStatisticsMapper>(); _statisticsMapper.Setup(x => x.MapFrom(It.IsAny <Statistics>())).Returns(new ConsistencyStatistics()); _statisticsOrchestrator = new StatisticsOrchestrator(_mockMediator.Object, Mock.Of <ICommitmentsLogger>(), _statisticsMapper.Object); _controller = new StatisticsController(_statisticsOrchestrator); }
public StatisticsController(StatisticsOrchestrator statisticsOrchestrator) { _statisticsOrchestrator = statisticsOrchestrator; }
public void Setup() { MockMediator = new Mock <IMediator>(); Orchestrator = new StatisticsOrchestrator(MockMediator.Object, Mock.Of <ICommitmentsLogger>(), new StatisticsMapper()); }