コード例 #1
0
        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 });
        }
コード例 #2
0
        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>());
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        protected override void EstablishContext()
        {
            schoolCategoryProvider = mocks.StrictMock<ISchoolCategoryProvider>();
            metricCorrelationService = mocks.StrictMock<IMetricCorrelationProvider>();
            footnoteRepository = mocks.StrictMock<IRepository<MetricInstanceFootnote>>();
            classroomMetricsProvider = mocks.StrictMock<IClassroomMetricsProvider>();
            listMetadataProvider = mocks.StrictMock<IListMetadataProvider>();
            metadataListIdResolver = mocks.StrictMock<IMetadataListIdResolver>();
            metricNodeResolver = mocks.StrictMock<IMetricNodeResolver>();
            StudentMetricProvider = mocks.StrictMock<IStudentMetricsProvider>();
            gradeLevelUtilitiesProvider = mocks.StrictMock<IGradeLevelUtilitiesProvider>();
            schoolMetricStudentListRepository = mocks.StrictMock<IRepository<SchoolMetricStudentList>>();

            Expect.Call(StudentMetricProvider.GetOrderedStudentList(null, null, null)).Repeat.Any().IgnoreArguments().Return(GetSuppliedStudentList());
            Expect.Call(StudentMetricProvider.GetStudentsWithMetrics(null)).Repeat.Any().IgnoreArguments().Return(GetStudentListPageData());
            Expect.Call(metricCorrelationService.GetRenderingParentMetricVariantIdForStudent(suppliedMetricVariantId, suppliedSchoolId)).Repeat.Any().Return(new MetricCorrelationProvider.MetricRenderingContext { MetricVariantId = suppliedRenderingMetricVariantId, ContextMetricVariantId = suppliedContextMetricVariantId });
            Expect.Call(metricNodeResolver.GetMetricNodeForSchoolFromMetricVariantId(suppliedSchoolId, suppliedMetricVariantId)).Repeat.AtLeastOnce().Return(GetSuppliedMetricMetadataNode());
            Expect.Call(footnoteRepository.GetAll()).Repeat.Any().Return(GetSuppliedMetricFootnotes());
            Expect.Call(metadataListIdResolver.GetListId(ListType.ClassroomGeneralOverview, SchoolCategory.HighSchool)).IgnoreArguments().Repeat.Any().Return(1);
            Expect.Call(schoolMetricStudentListRepository.GetAll()).Return(GetSchoolMetricStudentList());

            suppliedMetadataColumnGroupList = GetSuppliedListMetadata();
            Expect.Call(listMetadataProvider.GetListMetadata(1)).IgnoreArguments().Repeat.Any().Return(suppliedMetadataColumnGroupList);

            Expect.Call(classroomMetricsProvider.GetAdditionalMetrics(null, null))
                .IgnoreArguments()
                .Repeat.Any()
                .Return(new List<StudentWithMetrics.Metric>());

            expectedStudentIds.Clear();
            expectedStudentIds.Add(suppliedStudentId1);
            expectedStudentIds.Add(suppliedStudentId2);
            expectedStudentIds.Add(suppliedStudentId3);
            expectedStudentIds.Add(suppliedStudentId4);

            expectedSchoolCategory = SchoolCategory.HighSchool;

            base.EstablishContext();
        }
コード例 #5
0
        protected override void EstablishContext()
        {
            schoolCategoryProvider = mocks.StrictMock<ISchoolCategoryProvider>();
            uniqueListProvider = mocks.StrictMock<IUniqueListIdProvider>();
            metricCorrelationService = mocks.StrictMock<IMetricCorrelationProvider>();
            classroomMetricsProvider = mocks.StrictMock<IPriorYearClassroomMetricsProvider>();
            listMetadataProvider = mocks.StrictMock<IListMetadataProvider>();
            metadataListIdResolver = mocks.StrictMock<IMetadataListIdResolver>();
            metricNodeResolver = mocks.StrictMock<IMetricNodeResolver>();
            warehouseAvailabilityProvider = mocks.StrictMock<IWarehouseAvailabilityProvider>();
            maxPriorYearProvider = mocks.StrictMock<IMaxPriorYearProvider>();
            gradeLevelUtilitiesProvider = mocks.StrictMock<IGradeLevelUtilitiesProvider>();
            priorYearStudentMetricsProvider = mocks.StrictMock<IPriorYearStudentMetricsProvider>();
            studentMetricsProvider = mocks.StrictMock<IStudentMetricsProvider>();

            Expect.Call(maxPriorYearProvider.Get(suppliedLocalEducationAgencyId)).Repeat.Any().Return(2011);
            Expect.Call(metricNodeResolver.GetMetricNodeForSchoolFromMetricVariantId(suppliedSchoolId,
                suppliedMetricVariantId)).Repeat.Any().Return(GetSuppliedMetricMetadataNode());
            Expect.Call(metricCorrelationService.GetRenderingParentMetricVariantIdForStudent(suppliedMetricVariantId,
                suppliedSchoolId)).Repeat.Any()
                .Return(new MetricCorrelationProvider.MetricRenderingContext
                {
                    MetricVariantId = suppliedRenderingMetricVariantId,
                    ContextMetricVariantId = suppliedContextMetricVariantId
                });
            Expect.Call(uniqueListProvider.GetUniqueId(suppliedMetricVariantId)).Repeat.Any().Return(suppliedUniqueListId);
            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.GetStudentList(GetPriorYearStudentListWithMetricsQueryOptions()))
                .IgnoreArguments()
                .Repeat.Any()
                .Return(GetExpectedPriorYearStudentList());
            Expect.Call(studentMetricsProvider.GetOrderedStudentList(GetStudentListWithMetricsQueryOptions()))
                .IgnoreArguments()
                .Repeat.Any()
                .Return(
                    GetStudentSectionEntityListData()
                        .Where(x => expectedStudentIds.Contains(x.StudentUSI) && x.SchoolId == suppliedSchoolId)
                        .AsQueryable());
            Expect.Call(
                priorYearStudentMetricsProvider.GetStudentsWithMetrics(GetPriorYearStudentListWithMetricsQueryOptions()))
                .IgnoreArguments()
                .Repeat.Any()
                .Return(
                    GetSuppliedPriorYearSchoolMetricStudentList()
                        .Where(x => expectedStudentIds.Contains(x.StudentUSI) && x.SchoolId == suppliedSchoolId));
            Expect.Call(studentMetricsProvider.GetStudentsWithMetrics(GetStudentListWithMetricsQueryOptions()))
                .IgnoreArguments()
                .Repeat.Any()
                .Return(
                    GetStudentListSectionPageData()
                        .Where(x => expectedStudentIds.Contains(x.StudentUSI) && x.SchoolId == suppliedSchoolId)
                        .AsQueryable());
            Expect.Call(classroomMetricsProvider.GetAdditionalMetrics(null, null, null))
                .IgnoreArguments()
                .Repeat.Any()
                .Return(new List<StudentWithMetrics.Metric>());

            base.EstablishContext();
        }
コード例 #6
0
        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);
        }