protected override void EstablishContext()
        {
            schoolMetricHistoricalRepository = mocks.StrictMock<IRepository<SchoolMetricHistorical>>();
            metricGoalProvider = mocks.StrictMock<IMetricGoalProvider>();
            metricStateProvider = mocks.StrictMock<IMetricStateProvider>();
            metricInstanceSetKeyResolver = mocks.StrictMock<IMetricInstanceSetKeyResolver<SchoolMetricInstanceSetRequest>>();
            trendRenderingDispositionProvider = mocks.StrictMock<ITrendRenderingDispositionProvider>();
            metricNodeResolver = mocks.StrictMock<IMetricNodeResolver>();
            warehouseAvailabilityProvider = mocks.StrictMock<IWarehouseAvailabilityProvider>();

            suppliedSchoolMetricHistorical = GetSuppliedSchoolMetricHistorical();

            Expect.Call(warehouseAvailabilityProvider.Get()).Return(true);
            Expect.Call(metricNodeResolver.GetMetricNodeForSchoolFromMetricVariantId(schoolId1, metricVariantId1)).Return(GetSuppliedMetricMetadataNode());
            Expect.Call(schoolMetricHistoricalRepository.GetAll()).Repeat.Any().Return(suppliedSchoolMetricHistorical);
            Expect.Call(metricGoalProvider.GetMetricGoal(suppliedSchoolMetricInstanceSetKey1, metricId1)).Return(schoolGoal1);
            //This is tested elsewhere so we ignore and return a fixed value.
            Expect.Call(metricStateProvider.GetState(1, ".0", "System.IgnoreThisParam")).IgnoreArguments().Repeat.Any().
                Return(new State(MetricStateType.Good, "Good"));

            Expect.Call(
                metricInstanceSetKeyResolver.GetMetricInstanceSetKey(null))
                .Constraints(
                    new ActionConstraint<SchoolMetricInstanceSetRequest>(x =>
                    {
                        Assert.That(x.SchoolId == schoolId1);
                        Assert.That(x.MetricVariantId == metricVariantId1);
                    })
                ).
                Return(suppliedSchoolMetricInstanceSetKey1);

            Expect.Call(trendRenderingDispositionProvider.GetTrendRenderingDisposition(TrendDirection.Decreasing, TrendInterpretation.Standard)).IgnoreArguments().Repeat.Any().Return(TrendEvaluation.UpNoOpinion);
        }
        protected override void EstablishContext()
        {
            schoolMetricInstanceTeacherListRepository = mocks.StrictMock<IRepository<SchoolMetricInstanceTeacherList>>();
            staffInformationRepository = mocks.StrictMock<IRepository<StaffInformation>>();
            staffEdOrgRepository = mocks.StrictMock<IRepository<StaffEducationOrgInformation>>();
            uniqueListProvider = mocks.StrictMock<IUniqueListIdProvider>();
            metricNodeResolver = mocks.StrictMock<IMetricNodeResolver>();
            staffLinks = mocks.StrictMock<IStaffAreaLinks>();
            codeIdProvider = mocks.StrictMock<ICodeIdProvider>();
            localEducationAgencyContextProvider = mocks.StrictMock<ILocalEducationAgencyContextProvider>();
            warehouseAvailabilityProvider = mocks.StrictMock<IWarehouseAvailabilityProvider>();
            maxPriorYearProvider = mocks.StrictMock<IMaxPriorYearProvider>();

            Expect.Call(warehouseAvailabilityProvider.Get()).Return(suppliedWarehouseAvailability);

            if (suppliedWarehouseAvailability)
            {
                Expect.Call(metricNodeResolver.GetMetricNodeForSchoolFromMetricVariantId(-1, -1)).IgnoreArguments().Return(GetMetricMetadataNode());
                Expect.Call(localEducationAgencyContextProvider.GetCurrentLocalEducationAgencyCode()).Return("Code");
                Expect.Call(codeIdProvider.Get("Code")).Return(1);
                Expect.Call(maxPriorYearProvider.Get(1)).Return(2012);
                Expect.Call(schoolMetricInstanceTeacherListRepository.GetAll()).Return(GetSuppliedSchoolMetricInstanceTeacherList());
                Expect.Call(uniqueListProvider.GetUniqueId(suppliedMetricVariantId)).Return(suppliedUniqueId);


                if (isStaffCountGreaterThanZero)
                {
                    Expect.Call(staffEdOrgRepository.GetAll()).Return(GetSuppliedStaffEdOrg());
                    Expect.Call(staffInformationRepository.GetAll()).Return(GetStaffInformation());
                    Expect.Call(staffLinks.Default(-1, -1, string.Empty, null, null, null)).IgnoreArguments().Return(string.Empty);
                }
            }

            base.EstablishContext();
        }
        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 });
        }
        protected override void EstablishContext()
        {
            suppliedRequest = new SchoolMetricInstanceSetRequest{ SchoolId = suppliedSchoolId, MetricVariantId = suppliedMetricVariantId};
            metricInstanceRepository = mocks.StrictMock<IRepository<SchoolMetricInstance>>();
            metricInstanceExtendedPropertyRepository = mocks.StrictMock<IRepository<SchoolMetricInstanceExtendedProperty>>();
            metricComponentRepository = mocks.StrictMock<IRepository<SchoolMetricComponent>>();
            schoolBriefService = mocks.StrictMock<IBriefService>();
            metricInstanceSetKeyResolver = mocks.StrictMock<IMetricInstanceSetKeyResolver<SchoolMetricInstanceSetRequest>>();
            warehouseAvailabilityProvider = mocks.StrictMock<IWarehouseAvailabilityProvider>();
            maxPriorYearProvider = mocks.StrictMock<IMaxPriorYearProvider>();

            Expect.Call(metricInstanceRepository.GetAll()).Return(GetMetricInstances());
            Expect.Call(metricInstanceExtendedPropertyRepository.GetAll()).Return(GetMetricInstanceExtendedProperties());
            Expect.Call(metricComponentRepository.GetAll()).Return(GetMetricComponentProperties());
            Expect.Call(schoolBriefService.Get(null)).IgnoreArguments().Return(new BriefModel { LocalEducationAgencyId = suppliedLocalEducationAgencyId });
            Expect.Call(metricInstanceSetKeyResolver.GetMetricInstanceSetKey(suppliedRequest)).Return(suppliedMetricInstanceSetKey);
            Expect.Call(warehouseAvailabilityProvider.Get()).Return(true);
            Expect.Call(maxPriorYearProvider.Get(suppliedLocalEducationAgencyId)).Return(2011);
        }
        protected override void EstablishContext()
        {
            suppliedRequest = new SchoolMetricInstanceSetRequest { SchoolId = suppliedSchoolId, MetricVariantId = suppliedMetricVariantId };
            schoolBriefService = mocks.StrictMock<IBriefService>();
            metricInstanceSetKeyResolver = mocks.StrictMock<IMetricInstanceSetKeyResolver<SchoolMetricInstanceSetRequest>>();
            warehouseAvailabilityProvider = mocks.StrictMock<IWarehouseAvailabilityProvider>();
            maxPriorYearProvider = mocks.StrictMock<IMaxPriorYearProvider>();
            schoolMetricDataService = mocks.StrictMock<ISchoolMetricDataService>();

            Expect.Call(warehouseAvailabilityProvider.Get()).Return(false);
        }
        protected override void EstablishContext()
        {
            studentListWithMetricsRepository = mocks.StrictMock<IRepository<StudentMetric>>();
            teacherStudentSectionRepository = mocks.StrictMock<IRepository<TeacherStudentSection>>();
            teacherSectionRepository = mocks.StrictMock<IRepository<TeacherSection>>();
            staffStudentCohortRepository = mocks.StrictMock<IRepository<StaffStudentCohort>>();
            staffCohortRepository = mocks.StrictMock<IRepository<StaffCohort>>();
            staffCustomStudentListRepository = mocks.StrictMock<IRepository<StaffCustomStudentList>>();
            staffCustomStudentListStudentRepository = mocks.StrictMock<IRepository<StaffCustomStudentListStudent>>();
            schoolCategoryProvider = mocks.StrictMock<ISchoolCategoryProvider>();
            accommodationProvider = mocks.StrictMock<IAccommodationProvider>();
            uniqueListProvider = mocks.StrictMock<IUniqueListIdProvider>();
            trendRenderingDispositionProvider = mocks.StrictMock<ITrendRenderingDispositionProvider>();
            rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>();
            metricStateProvider = mocks.StrictMock<IMetricStateProvider>();
            listMetadataProvider = mocks.StrictMock<IListMetadataProvider>();
            priorYearClassroomMetricsProvider = mocks.StrictMock<IPriorYearClassroomMetricsProvider>();
            metadataListIdResolver = mocks.StrictMock<IMetadataListIdResolver>();
            warehouseAvailabilityProvider = mocks.StrictMock<IWarehouseAvailabilityProvider>();
            maxPriorYearProvider = mocks.StrictMock<IMaxPriorYearProvider>();
            studentMetricsProvider = mocks.StrictMock<IStudentMetricsProvider>();
            gradeLevelUtilitiesProvider = mocks.StrictMock<IGradeLevelUtilitiesProvider>();
            priorYearStudentMetricsProvider = mocks.StrictMock<IPriorYearStudentMetricsProvider>();

            Expect.Call(studentListWithMetricsRepository.GetAll()).Repeat.Any().Return(GetSuppliedStudentMetrics());
            Expect.Call(teacherStudentSectionRepository.GetAll()).Repeat.Any().Return(GetSuppliedTeacherStudentSection());
            Expect.Call(teacherSectionRepository.GetAll()).Repeat.Any().Return(GetSuppliedTeacherSection());
            Expect.Call(staffStudentCohortRepository.GetAll()).Repeat.Any().Return(GetSuppliedStaffStudentCohort());
            Expect.Call(staffCohortRepository.GetAll()).Repeat.Any().Return(GetSuppliedStaffCohort());
            Expect.Call(staffCustomStudentListRepository.GetAll()).Repeat.Any().Return(GetSuppliedStaffCustomStudentList());
            Expect.Call(staffCustomStudentListStudentRepository.GetAll()).Repeat.Any().Return(GetSuppliedStaffCustomStudentListStudent());

            Expect.Call(uniqueListProvider.GetUniqueId()).Return(suppliedUniqueListId);

            Expect.Call(trendRenderingDispositionProvider.GetTrendRenderingDisposition(TrendDirection.Decreasing, TrendInterpretation.Standard)).IgnoreArguments().Repeat.Any().Return(TrendEvaluation.DownBad);
            Expect.Call(accommodationProvider.GetAccommodations(expectedStudentIds.ToArray(), suppliedSchoolId)).Return(GetSuppliedAccommodations());

            Expect.Call(rootMetricNodeResolver.GetRootMetricNodeForStudent(suppliedSchoolId)).Repeat.Any().Return(GetStudentRootOverviewNode());

            Expect.Call(metricStateProvider.GetState(41, 1)).Repeat.Any().Return(new State { StateText = suppliedFourByFourText, DisplayStateText = suppliedFourByFourDisplayText });

            //Tested Elsewhere.
            Expect.Call(metadataListIdResolver.GetListId(ListType.ClassroomGeneralOverview, SchoolCategory.HighSchool)).IgnoreArguments().Repeat.Any().Return(1);
            Expect.Call(listMetadataProvider.GetListMetadata(1)).IgnoreArguments().Repeat.Any().Return(GetSuppliedListMetadata());
            Expect.Call(priorYearStudentMetricsProvider.GetStudentsWithMetrics(GetPriorYearStudentListWithMetricsQueryOptions()))
                .IgnoreArguments()
                .Repeat.Any()
                .Return(GetPriorYearStudentMetrics(suppliedLocalEducationAgencyId).AsQueryable());

            Expect.Call(warehouseAvailabilityProvider.Get()).Return(true);
            Expect.Call(maxPriorYearProvider.Get(suppliedLocalEducationAgencyId)).Return(2011);
            Expect.Call(studentMetricsProvider.GetOrderedStudentList(GetStudentListWithMetricsQueryOptions())).IgnoreArguments().Repeat.Any().Return(GetStudentSectionEntityListData(suppliedStudentListType).ToList().AsQueryable());
            Expect.Call(studentMetricsProvider.GetStudentsWithMetrics(GetStudentListWithMetricsQueryOptions())).IgnoreArguments().Repeat.Any().Return(GetStudentListSectionPageData(suppliedStudentListType).AsQueryable());
            Expect.Call(gradeLevelUtilitiesProvider.FormatGradeLevelForDisplay("1")).IgnoreArguments().Repeat.AtLeastOnce().Return("");
            Expect.Call(gradeLevelUtilitiesProvider.FormatGradeLevelForSorting("1")).IgnoreArguments().Repeat.AtLeastOnce().Return(1);

            base.EstablishContext();
        }
        protected override void EstablishContext()
        {
            studentListWithMetricsRepository = mocks.StrictMock<IRepository<StudentMetric>>();
            teacherStudentSectionRepository = mocks.StrictMock<IRepository<TeacherStudentSection>>();
            teacherSectionRepository = mocks.StrictMock<IRepository<TeacherSection>>();
            staffStudentCohortRepository = mocks.StrictMock<IRepository<StaffStudentCohort>>();
            staffCohortRepository = mocks.StrictMock<IRepository<StaffCohort>>();
            schoolCategoryProvider = mocks.StrictMock<ISchoolCategoryProvider>();
            accommodationProvider = mocks.StrictMock<IAccommodationProvider>();
            uniqueListProvider = mocks.StrictMock<IUniqueListIdProvider>();
            trendRenderingDispositionProvider = mocks.StrictMock<ITrendRenderingDispositionProvider>();
            rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>();
            metricStateProvider = mocks.StrictMock<IMetricStateProvider>();
            listMetadataProvider = mocks.StrictMock<IListMetadataProvider>();
            priorYearClassroomMetricsProvider = mocks.StrictMock<IPriorYearClassroomMetricsProvider>();
            metadataListIdResolver = mocks.StrictMock<IMetadataListIdResolver>();
            warehouseAvailabilityProvider = mocks.StrictMock<IWarehouseAvailabilityProvider>();
            maxPriorYearProvider = mocks.StrictMock<IMaxPriorYearProvider>();

            Expect.Call(warehouseAvailabilityProvider.Get()).Return(false);

            base.EstablishContext();
        }
        protected override void EstablishContext()
        {
            studentMetricHistoricalRepository = mocks.StrictMock<IRepository<SchoolMetricHistorical>>();
            metricGoalProvider = mocks.StrictMock<IMetricGoalProvider>();
            metricStateProvider = mocks.StrictMock<IMetricStateProvider>();
            metricInstanceSetKeyResolver = mocks.StrictMock<IMetricInstanceSetKeyResolver<SchoolMetricInstanceSetRequest>>();
            trendRenderingDispositionProvider = mocks.StrictMock<ITrendRenderingDispositionProvider>();
            metricNodeResolver = mocks.StrictMock<IMetricNodeResolver>();
            warehouseAvailabilityProvider = mocks.StrictMock<IWarehouseAvailabilityProvider>();

            Expect.Call(warehouseAvailabilityProvider.Get()).Return(false);
        }
        protected override void EstablishContext()
        {
            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>();

            Expect.Call(warehouseAvailabilityProvider.Get()).Return(false);
        }