Example #1
0
 public BenchmarkChartsController(IBenchmarkChartBuilder benchmarkChartBuilder, IFinancialDataService financialDataService, IFinancialCalculationsService fcService, ILocalAuthoritiesService laService, IDownloadCSVBuilder csvBuilder,
                                  IContextDataService contextDataService, IBenchmarkCriteriaBuilderService benchmarkCriteriaBuilderService, IComparisonService comparisonService)
 {
     _benchmarkChartBuilder           = benchmarkChartBuilder;
     _financialDataService            = financialDataService;
     _fcService                       = fcService;
     _laService                       = laService;
     _csvBuilder                      = csvBuilder;
     _contextDataService              = contextDataService;
     _benchmarkCriteriaBuilderService = benchmarkCriteriaBuilderService;
     _comparisonService               = comparisonService;
 }
Example #2
0
        public void TabChangeShouldKeepUnitTypeBetweenExpenditureAndBalanceTabsIfPossible()
        {
            var mockDocumentDbService = new Mock <IFinancialDataService>();

            var mockEdubaseDataService = new Mock <IContextDataService>();

            var mockBenchmarkChartBuilder = new Mock <IBenchmarkChartBuilder>();

            mockBenchmarkChartBuilder
            .Setup(cb => cb.Build(It.IsAny <RevenueGroupType>(), It.IsAny <EstablishmentType>()))
            .Returns((RevenueGroupType revenueGroup, EstablishmentType schoolType) => new List <ChartViewModel>()
            {
                new ChartViewModel()
                {
                    ChartGroup = ChartGroupType.Staff
                }
            });

            var financialCalculationsService = new Mock <IFinancialCalculationsService>();

            var mockLaService = new Mock <ILocalAuthoritiesService>();

            var mockComparisonService = new Mock <IComparisonService>();

            IBenchmarkCriteriaBuilderService benchmarkCriteriaBuilderService = null;

            var controller = new BenchmarkChartsController(mockBenchmarkChartBuilder.Object, mockDocumentDbService.Object, financialCalculationsService.Object, mockLaService.Object, null, mockEdubaseDataService.Object, benchmarkCriteriaBuilderService, mockComparisonService.Object);

            controller.ControllerContext = new ControllerContext(_rc, controller);

            controller.TabChange(EstablishmentType.Maintained, UnitType.PerPupil, RevenueGroupType.Balance);

            financialCalculationsService.Verify(f => f.PopulateBenchmarkChartsWithFinancialData(
                                                    null,
                                                    It.IsAny <List <SchoolFinancialDataModel> >(),
                                                    It.IsAny <IEnumerable <CompareEntityBase> >(),
                                                    It.IsAny <string>(),
                                                    UnitType.PerPupil,
                                                    It.IsAny <bool>()));
        }
Example #3
0
 public ComparisonService(IFinancialDataService financialDataService, IBenchmarkCriteriaBuilderService benchmarkCriteriaBuilderService)
 {
     _financialDataService            = financialDataService;
     _benchmarkCriteriaBuilderService = benchmarkCriteriaBuilderService;
 }