protected override void EstablishContext()
        {
            suppliedMetricInstanceSetKey_ForWantedData = new Guid("56cff024-f54a-4a7f-89c2-5af94a4660da");
            suppliedRequest = new TestMetricInstanceSetRequestBase();

            //Use mock data
            metricInstanceSetKeyResolver = mocks.StrictMock<IMetricInstanceSetKeyResolver<TestMetricInstanceSetRequestBase>>();
            Expect.Call(metricInstanceSetKeyResolver.GetMetricInstanceSetKey(suppliedRequest)).Return(suppliedMetricInstanceSetKey_ForWantedData);

            metricInstancesService = mocks.StrictMock<IMetricInstancesService>();
            Expect.Call(metricInstancesService.Get(null)).IgnoreArguments().Return(GetSuppliedMetricInstanceData());

            metricInstanceExtendedPropertiesService = mocks.StrictMock<IMetricInstanceExtendedPropertiesService>();
            Expect.Call(metricInstanceExtendedPropertiesService.Get(null)).IgnoreArguments().Return(GetSuppliedMetricInstanceExtendedPropertyData());

            metricComponentsService = mocks.StrictMock<IMetricComponentsService>();
            Expect.Call(metricComponentsService.Get(null)).IgnoreArguments().Return(GetSuppliedMetricComponentData());

            metricGoalsService = mocks.StrictMock<IMetricGoalsService>();
            Expect.Call(metricGoalsService.Get(null)).IgnoreArguments().Return(GetSuppliedMetricGoalData());

            metricIndicatorsService = mocks.StrictMock<IMetricIndicatorsService>();
            Expect.Call(metricIndicatorsService.Get(null)).IgnoreArguments().Return(GetSuppliedMetricIndicatorData());

            metricFootnoteDescType = mocks.StrictMock<IMetricFootnoteDescriptionTypesService>();
            Expect.Call(metricFootnoteDescType.Get(null)).IgnoreArguments().Return(getSuppliedMetricFootnotDescTypeData());

            metricInstanceFootnotesService = mocks.StrictMock<IMetricInstanceFootnotesService>();
            Expect.Call(metricInstanceFootnotesService.Get(null)).IgnoreArguments().Return(GetSuppliedMetricFootnoteData());
        }
        protected override void EstablishContext()
        {
            //Prepare supplied data collections
            suppliedStudentMetricBenchmarkAssessmentData = GetSuppliedStudentMetricBenchmarkAssessment();
            suppliedSchoolGoal = GetSuppliedMetricGoal();
            suppliedMetricState = GetSuppliedMetricState();

            //Set up the mocks
            metricNodeResolver = mocks.StrictMock<IMetricNodeResolver>();
            studentMetricBenchmarkAssessmentRepository = mocks.StrictMock<IRepository<StudentMetricBenchmarkAssessment>>();
            metricGoalProvider = mocks.StrictMock<IMetricGoalProvider>();
            metricStateProvider = mocks.StrictMock<IMetricStateProvider>();
            metricInstanceSetKeyResolver = mocks.StrictMock<IMetricInstanceSetKeyResolver<StudentSchoolMetricInstanceSetRequest>>();

            //Set expectations
            Expect.Call(metricNodeResolver.GetMetricNodeForStudentFromMetricVariantId(suppliedSchoolId, suppliedMetricVariantId)).Return(GetMetricMetadataNode());
            Expect.Call(studentMetricBenchmarkAssessmentRepository.GetAll()).Return(suppliedStudentMetricBenchmarkAssessmentData);
            Expect.Call(
                metricInstanceSetKeyResolver.GetMetricInstanceSetKey(null))
                .Constraints(
                    new ActionConstraint<StudentSchoolMetricInstanceSetRequest>(x =>
                    {
                        Assert.That(x.SchoolId == suppliedSchoolId);
                        Assert.That(x.MetricVariantId == suppliedMetricVariantId);
                        Assert.That(x.StudentUSI == suppliedStudentUSI);
                    })
                ).Return(suppliedMetricInstanceSetKey);
            Expect.Call(metricGoalProvider.GetMetricGoal(suppliedMetricInstanceSetKey, suppliedMetricId)).Return(suppliedSchoolGoal);
            Expect.Call(metricStateProvider.GetState(suppliedMetricId, suppliedMetricValueStr, "System.Double")).Repeat.Any().Return(suppliedMetricState);
            Expect.Call(metricStateProvider.GetState(suppliedMetricId, "", "System.Double")).Return(suppliedMetricState);
        }
        protected override void EstablishContext()
        {
            schoolMetricTeacherListRepository = mocks.StrictMock<IRepository<SchoolMetricTeacherList>>();
            staffInformationRepository = mocks.StrictMock<IRepository<StaffInformation>>();
            staffEducationOrgInformationRepository = mocks.StrictMock<IRepository<StaffEducationOrgInformation>>();
            footnoteRepository = mocks.StrictMock<IRepository<MetricInstanceFootnote>>();
            uniqueListIdProvider = mocks.StrictMock<IUniqueListIdProvider>();
            metricInstanceSetKeyResolver = mocks.StrictMock<IMetricInstanceSetKeyResolver<SchoolMetricInstanceSetRequest>>();
            metricNodeResolver = mocks.StrictMock<IMetricNodeResolver>();

            suppliedSchoolMetricTeacherList = GetSuppliedSchoolMetricTeacherList();
            suppliedStaffInformationList = GetSuppliedStaffInformationList();
            suppliedStaffEducationOrgInformationList = GetSuppliedStaffEducationOrgInformationList();
            suppliedFootnoteList = GetSuppliedFootnoteList();

            Expect.Call(metricNodeResolver.GetMetricNodeForSchoolFromMetricVariantId(suppliedSchoolId, suppliedMetricVariantId)).Return(GetSuppliedMetricMetadataNode());
            Expect.Call(schoolMetricTeacherListRepository.GetAll()).Repeat.Any().Return(suppliedSchoolMetricTeacherList);
            Expect.Call(staffEducationOrgInformationRepository.GetAll()).Repeat.Any().Return(suppliedStaffEducationOrgInformationList);
            Expect.Call(staffInformationRepository.GetAll()).Repeat.Any().Return(suppliedStaffInformationList);
            Expect.Call(footnoteRepository.GetAll()).Repeat.Any().Return(suppliedFootnoteList);
            Expect.Call(uniqueListIdProvider.GetUniqueId(suppliedMetricVariantId)).Return(suppliedUniqueListId);
            Expect.Call(metricInstanceSetKeyResolver.GetMetricInstanceSetKey(null))
                .Constraints(
                    new ActionConstraint<SchoolMetricInstanceSetRequest>(x =>
                    {
                        Assert.That(x.SchoolId == suppliedSchoolId);
                        Assert.That(x.MetricVariantId == suppliedMetricVariantId);
                    })
                ).Return(suppliedMetricInstanceSetKey);

        }
        protected override void EstablishContext()
        {
            SetSuppliedGoal();

            base.EstablishContext();

            suppliedData = GetData();

            repository = mocks.StrictMock<IRepository<SchoolMetricGradeDistribution>>();
            metricInstanceSetKeyResolver = mocks.StrictMock<IMetricInstanceSetKeyResolver<SchoolMetricInstanceSetRequest>>();
            metricGoalProvider = mocks.StrictMock<IMetricGoalProvider>();
            metricNodeResolver = mocks.StrictMock<IMetricNodeResolver>();

            Expect.Call(metricNodeResolver.GetMetricNodeForSchoolFromMetricVariantId(suppliedSchoolId, suppliedMetricVariantId)).Return(GetSuppliedMetricMetadataNode());
            Expect.Call(repository.GetAll()).Return(suppliedData);
            Expect.Call(metricInstanceSetKeyResolver.GetMetricInstanceSetKey(null))
                .Constraints(
                    new ActionConstraint<SchoolMetricInstanceSetRequest>(x =>
                    {
                        Assert.That(x.SchoolId == suppliedSchoolId);
                        Assert.That(x.MetricVariantId == suppliedMetricVariantId);
                    })
                ).Return(suppliedMetricInstanceSetKey);
            Expect.Call(metricGoalProvider.GetMetricGoal(suppliedMetricInstanceSetKey, suppliedMetricId)).Return(suppliedGoal);
        }
        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()
        {
            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 });
        }
Esempio n. 7
0
        protected virtual ChartData.StripLine[] GetStripLines(long studentUSI, int metricId, int metricVariantId, int schoolId, string format)
        {
            var metricInstanceSetKey = _metricInstanceSetKeyResolver.GetMetricInstanceSetKey(StudentSchoolMetricInstanceSetRequest.Create(schoolId, studentUSI, metricVariantId));
            var metricGoal           = _metricGoalProvider.GetMetricGoal(metricInstanceSetKey, metricId);

            if (metricGoal == null || metricGoal.Value == null)
            {
                return(new ChartData.StripLine[0]);
            }
            //If we have a goal then add a StripLine.
            var stripLine = new ChartData.StripLine
            {
                Value = Convert.ToDouble(metricGoal.Value),
                IsNegativeThreshold = metricGoal.Interpretation == TrendInterpretation.Inverse
            };

            return(new[] { stripLine });
        }
        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()
        {
            base.EstablishContext();

            suppliedData = GetData();
            suppliedFootnoteList = GetSuppliedFootnoteList();

            repository = mocks.StrictMock<IRepository<SchoolMetricAssessmentRate>>();
            footnoteRepository = mocks.StrictMock<IRepository<MetricInstanceFootnote>>();
            metricInstanceSetKeyResolver = mocks.StrictMock<IMetricInstanceSetKeyResolver<SchoolMetricInstanceSetRequest>>();
            metricNodeResolver = mocks.StrictMock<IMetricNodeResolver>();

            Expect.Call(metricNodeResolver.GetMetricNodeForSchoolFromMetricVariantId(suppliedSchoolId, suppliedMetricVariantId)).Return(GetSuppliedMetricMetadata());
            Expect.Call(repository.GetAll()).Return(suppliedData);
            Expect.Call(footnoteRepository.GetAll()).Repeat.Any().Return(suppliedFootnoteList);
            Expect.Call(metricInstanceSetKeyResolver.GetMetricInstanceSetKey(null))
                .Constraints(
                    new ActionConstraint<SchoolMetricInstanceSetRequest>(x =>
                    {
                        Assert.That(x.SchoolId == suppliedSchoolId);
                        Assert.That(x.MetricVariantId == suppliedMetricVariantId);
                    })
                ).Return(suppliedMetricInstanceSetKey);
        }
        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<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>();
            metricMetadataNodeService = mocks.StrictMock<IMetricMetadataTreeService>();
            metricNodeResolver = mocks.StrictMock<IMetricNodeResolver>();

            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(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);

            var tree = new TestMetricMetadataTree();
            Expect.Call(metricNodeResolver.GetMetricNodeForSchoolFromMetricVariantId(1, suppliedGranularCorrelationMetricVariantId)).Return(new MetricMetadataNode(tree) { MetricNodeId = suppliedGranularCorrelationMetricNodeId, Children = new List<MetricMetadataNode>() });
            Expect.Call(metricNodeResolver.GetMetricNodeForSchoolFromMetricVariantId(2, suppliedContainerCorrelationMetricVariantId)).Return(new MetricMetadataNode(tree) { MetricNodeId = suppliedContainerCorrelationMetricNodeId, Children = new List<MetricMetadataNode>() });
            Expect.Call(metricNodeResolver.GetMetricNodeForSchoolFromMetricVariantId(3, suppliedContainerCorrelationMetricVariantId)).Return(new MetricMetadataNode(tree) { MetricNodeId = suppliedContainerCorrelationMetricNodeId, Children = new List<MetricMetadataNode>() });
            Expect.Call(metricNodeResolver.GetMetricNodeForSchoolFromMetricVariantId(5, suppliedAggregateCorrelationMetricVariantId)).Return(new MetricMetadataNode(tree) { MetricNodeId = suppliedAggregateCorrelationMetricNodeId, Children = new List<MetricMetadataNode>() });

            Expect.Call(metricMetadataNodeService.Get(MetricMetadataTreeRequest.Create())).IgnoreArguments().Repeat.Any().Return(GetRootNode());
            SetupMetricCorrelationService();
        }
        protected override void EstablishContext()
        {
            //Prepare supplied data collections
            _suppliedStudentMetricAssessmentHistorical = GetSuppliedStudentMetricAssessmentHistorical();
            _suppliedStudentMetricAssessmentHistoricalMetaData = GetSuppliedStudentMetricAssessmentHistoricalMetaData();
            _suppliedSchoolGoal = GetSuppliedMetricGoal();

            //Set up the mocks
            _metricNodeResolver = mocks.StrictMock<IMetricNodeResolver>();
            _studentMetricAssessmentHistorical = mocks.StrictMock<IRepository<StudentMetricAssessmentHistorical>>();
            _studentMetricAssessmentHistoricalMetaData = mocks.StrictMock<IRepository<StudentMetricAssessmentHistoricalMetaData>>();
            _metricGoalProvider = mocks.StrictMock<IMetricGoalProvider>();
            _metricInstanceSetKeyResolver = mocks.StrictMock<IMetricInstanceSetKeyResolver<StudentSchoolMetricInstanceSetRequest>>();

            //Set expectations
            Expect.Call(_metricNodeResolver.GetMetricNodeForStudentFromMetricVariantId(SuppliedSchoolId, SuppliedMetricVariantId)).Return(GetMetricMetadataNode());
            Expect.Call(_studentMetricAssessmentHistorical.GetAll()).Return(_suppliedStudentMetricAssessmentHistorical);
            Expect.Call(_studentMetricAssessmentHistoricalMetaData.GetAll()).Return(_suppliedStudentMetricAssessmentHistoricalMetaData);
            Expect.Call(
                _metricInstanceSetKeyResolver.GetMetricInstanceSetKey(null))
                .Constraints(
                    new ActionConstraint<StudentSchoolMetricInstanceSetRequest>(x =>
                    {
                        Assert.That(x.SchoolId == SuppliedSchoolId);
                        Assert.That(x.MetricVariantId == SuppliedMetricVariantId);
                        Assert.That(x.StudentUSI == SuppliedStudentUsi);
                    })
                ).Return(_suppliedMetricInstanceSetKey);
            Expect.Call(_metricGoalProvider.GetMetricGoal(_suppliedMetricInstanceSetKey, SuppliedMetricId)).Return(_suppliedSchoolGoal);
        }