protected override void EstablishContext() { SetSuppliedGoal(); localEducationAgencyMetricSchoolListRepository = mocks.StrictMock<IRepository<LocalEducationAgencyMetricSchoolList>>(); staffInformationRepository = mocks.StrictMock<IRepository<StaffInformation>>(); schoolInformationRepository = mocks.StrictMock<IRepository<SchoolInformation>>(); uniqueListIdProvider = mocks.StrictMock<IUniqueListIdProvider>(); metricCorrelationService = mocks.StrictMock<IMetricCorrelationProvider>(); metricInstanceSetKeyResolver = mocks.StrictMock<IMetricInstanceSetKeyResolver<LocalEducationAgencyMetricInstanceSetRequest>>(); metricGoalProvider = mocks.StrictMock<IMetricGoalProvider>(); metricNodeResolver = mocks.StrictMock<IMetricNodeResolver>(); domainSpecificMetricNodeResolver = mocks.StrictMock<IDomainSpecificMetricNodeResolver>(); listMetadataProvider = mocks.StrictMock<IListMetadataProvider>(); metadataListIdResolver = mocks.StrictMock<IMetadataListIdResolver>(); suppliedLocalEducationAgencyMetricSchoolList = GetSuppliedLocalEducationAgencyMetricSchoolList(); suppliedStaffInformationList = GetSuppliedStaffInformationRepository(); suppliedSchoolInformationList = GetSuppliedSchoolInformationRepository(); Expect.Call(metricNodeResolver.GetMetricNodeForLocalEducationAgencyMetricVariantId(suppliedMetricVariantId)).Return(GetSuppliedMetricMetadataNode()); Expect.Call(localEducationAgencyMetricSchoolListRepository.GetAll()).Repeat.Any().Return(suppliedLocalEducationAgencyMetricSchoolList); Expect.Call(staffInformationRepository.GetAll()).Repeat.Any().Return(suppliedStaffInformationList); Expect.Call(schoolInformationRepository.GetAll()).Return(suppliedSchoolInformationList); Expect.Call(uniqueListIdProvider.GetUniqueId(suppliedMetricVariantId)).Return(suppliedListContext); Expect.Call(domainSpecificMetricNodeResolver.GetOperationalDashboardMetricNode()).Return(GetSuppliedOperationalDashboardMetricNode()); Expect.Call(metricInstanceSetKeyResolver.GetMetricInstanceSetKey(null)).Constraints( new ActionConstraint<LocalEducationAgencyMetricInstanceSetRequest>(x => { Assert.That(x.MetricVariantId == suppliedMetricVariantId); Assert.That(x.LocalEducationAgencyId == suppliedLocalEducationAgencyId); })).Return(suppliedMetricInstanceSetKey); Expect.Call(metricGoalProvider.GetMetricGoal(suppliedMetricInstanceSetKey, suppliedMetricId)).Return(suppliedGoal); Expect.Call(metricCorrelationService.GetRenderingParentMetricVariantIdForSchool(suppliedMetricVariantId, 1)).Constraints( Rhino.Mocks.Constraints.Is.Equal(suppliedMetricVariantId), Rhino.Mocks.Constraints.Is.Anything()).Repeat.Any().Return(new MetricCorrelationProvider.MetricRenderingContext { ContextMetricVariantId = suppliedContextMetricVariantId, MetricVariantId = suppliedCorrelationMetricVariantId }); Expect.Call(metadataListIdResolver.GetListId(ListType.SchoolMetricTable, SchoolCategory.None)).Return( MetadataListIdResolver.SchoolMetricTableListId); Expect.Call(listMetadataProvider.GetListMetadata(MetadataListIdResolver.SchoolMetricTableListId)).Return( new List<MetadataColumnGroup>()); }
protected override void EstablishContext() { SetSuppliedGoal(); localEducationAgencyMetricSchoolListRepository = mocks.StrictMock<IRepository<LocalEducationAgencyMetricInstanceSchoolList>>(); schoolInformationRepository = mocks.StrictMock<IRepository<SchoolInformation>>(); uniqueListIdProvider = mocks.StrictMock<IUniqueListIdProvider>(); metricCorrelationService = mocks.StrictMock<IMetricCorrelationProvider>(); metricInstanceSetKeyResolver = mocks.StrictMock<IMetricInstanceSetKeyResolver<LocalEducationAgencyMetricInstanceSetRequest>>(); metricGoalProvider = mocks.StrictMock<IMetricGoalProvider>(); metricNodeResolver = mocks.StrictMock<IMetricNodeResolver>(); warehouseAvailabilityProvider = mocks.StrictMock<IWarehouseAvailabilityProvider>(); maxPriorYearProvider = mocks.StrictMock<IMaxPriorYearProvider>(); suppliedLocalEducationAgencyMetricSchoolList = GetSuppliedLocalEducationAgencyMetricSchoolList(); suppliedSchoolInformationList = GetSuppliedSchoolInformationRepository(); Expect.Call(warehouseAvailabilityProvider.Get()).Return(true); Expect.Call(maxPriorYearProvider.Get(suppliedLocalEducationAgencyId)).Return(2011); Expect.Call(metricNodeResolver.GetMetricNodeForLocalEducationAgencyMetricVariantId(suppliedMetricVariantId)).Return(GetSuppliedMetricMetadataNode()); Expect.Call(localEducationAgencyMetricSchoolListRepository.GetAll()).Repeat.Any().Return(suppliedLocalEducationAgencyMetricSchoolList); Expect.Call(schoolInformationRepository.GetAll()).Return(suppliedSchoolInformationList); Expect.Call(uniqueListIdProvider.GetUniqueId(suppliedMetricVariantId)).Return(suppliedListContext); Expect.Call(metricInstanceSetKeyResolver.GetMetricInstanceSetKey(null)).Constraints( new ActionConstraint<LocalEducationAgencyMetricInstanceSetRequest>(x => { Assert.That(x.MetricVariantId == suppliedMetricVariantId); Assert.That(x.LocalEducationAgencyId == suppliedLocalEducationAgencyId); })).Return(suppliedMetricInstanceSetKey); Expect.Call(metricGoalProvider.GetMetricGoal(suppliedMetricInstanceSetKey, suppliedMetricId)).Return(suppliedGoal); Expect.Call(metricCorrelationService.GetRenderingParentMetricVariantIdForSchool(suppliedMetricVariantId, 1)).Constraints( Rhino.Mocks.Constraints.Is.Equal(suppliedMetricVariantId), Rhino.Mocks.Constraints.Is.Anything()).Repeat.Any().Return(new MetricCorrelationProvider.MetricRenderingContext { ContextMetricVariantId = suppliedContextMetricVariantId, MetricVariantId = suppliedCorrelationMetricVariantId }); }