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() { 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() { //Prepare supplied data collections suppliedStaffEducationOrgInformationData = GetSuppliedStaffEducationOrgInformation(); suppliedStaffInformationData = GetSuppliedStaffInformation(); suppliedStaffSectionCohortData = GetSuppliedStaffSectionCohortAssociation(); //Set up the mocks staffInformationRepository = mocks.StrictMock<IRepository<StaffInformation>>(); staffEducationOrgInformationRepository = mocks.StrictMock<IRepository<StaffEducationOrgInformation>>(); staffSectionCohortRepository = mocks.StrictMock<IRepository<StaffSectionCohortAssociation>>(); uniqueListIdProvider = mocks.StrictMock<IUniqueListIdProvider>(); //Set expectations Expect.Call(staffInformationRepository.GetAll()).Return(suppliedStaffInformationData); Expect.Call(staffEducationOrgInformationRepository.GetAll()).Return(suppliedStaffEducationOrgInformationData); Expect.Call(staffSectionCohortRepository.GetAll()).Return(suppliedStaffSectionCohortData); Expect.Call(uniqueListIdProvider.GetUniqueId()).Repeat.Any().Return(suppliedUniqueId); }
protected override void EstablishContext() { repository = mocks.StrictMock<IRepository<SchoolInformation>>(); schoolGradePopulationRepository = mocks.StrictMock<IRepository<SchoolGradePopulation>>(); uniqueListIdProvider = mocks.StrictMock<IUniqueListIdProvider>(); schoolCategoryProvider = mocks.StrictMock<ISchoolCategoryProvider>(); suppliedSchoolsInformation = GetSuppliedSchoolInformation(); suppliedSchoolGradePopulation = GetSuppliedSchoolGradePopulation(); Expect.Call(schoolCategoryProvider.GetSchoolCategoryPriorityForSorting("High School")).Repeat.Any().Return(1); Expect.Call(schoolCategoryProvider.GetSchoolCategoryPriorityForSorting("Junior High School")).Repeat.Any().Return(2); Expect.Call(schoolCategoryProvider.GetSchoolCategoryPriorityForSorting("Middle School")).Repeat.Any().Return(3); Expect.Call(schoolCategoryProvider.GetSchoolCategoryPriorityForSorting("Elementary School")).Repeat.Any().Return(4); Expect.Call(schoolCategoryProvider.GetSchoolCategoryPriorityForSorting("Ungraded")).Repeat.Any().Return(6); Expect.Call(repository.GetAll()).Return(suppliedSchoolsInformation); Expect.Call(schoolGradePopulationRepository.GetAll()).Repeat.Times(7).Return(suppliedSchoolGradePopulation); Expect.Call(uniqueListIdProvider.GetUniqueId()).Return(suppliedUniqueListId); }
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() { 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() { //Prepare supplied data collections suppliedStudentInformationData = GetSuppliedStudentInformation(); suppliedStudentSchoolInformationData = GetSuppliedStudentSchoolInformation(); //Set up the mocks studentInformationRepository = mocks.StrictMock<IRepository<StudentInformation>>(); studentSchoolInformationRepository = mocks.StrictMock<IRepository<StudentSchoolInformation>>(); uniqueListIdProvider = mocks.StrictMock<IUniqueListIdProvider>(); rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>(); gradeLevelUtilitiesProvider = mocks.StrictMock<IGradeLevelUtilitiesProvider>(); //Set expectations Expect.Call(studentInformationRepository.GetAll()).Return(suppliedStudentInformationData); Expect.Call(studentSchoolInformationRepository.GetAll()).Return(suppliedStudentSchoolInformationData); Expect.Call(uniqueListIdProvider.GetUniqueId()).Return(suppliedUniqueListIdProvider); Expect.Call(rootMetricNodeResolver.GetRootMetricNodeForStudent(suppliedSchoolId1)).Repeat.Any().Return(GetStudentRootOverviewNode()); Expect.Call(gradeLevelUtilitiesProvider.FormatGradeLevelForSorting("1")).IgnoreArguments().Repeat.AtLeastOnce().Return(1); }
protected override void EstablishContext() { studentSchoolLinks = new StudentSchoolAreaLinksFake(); staffCohortRepository = mocks.StrictMock<IRepository<StaffCohort>>(); staffCustomStudentListStudentRepository = mocks.StrictMock<IRepository<StaffCustomStudentListStudent>>(); staffCustomStudentListRepository = mocks.StrictMock<IRepository<StaffCustomStudentList>>(); uniqueListProvider = mocks.StrictMock<IUniqueListIdProvider>(); metadataListIdResolver = mocks.StrictMock<IMetadataListIdResolver>(); listMetadataProvider = mocks.StrictMock<IListMetadataProvider>(); classroomMetricsProvider = mocks.StrictMock<IClassroomMetricsProvider>(); gradeLevelUtilitiesProvider = mocks.StrictMock<IGradeLevelUtilitiesProvider>(); studentListWithMetricsProvider = mocks.StrictMock<IStudentMetricsProvider>(); Expect.Call(uniqueListProvider.GetUniqueId()).Return("StudentList" + suppliedStaffUSI); Expect.Call(staffCohortRepository.GetAll()).Repeat.Any().Return(GetStaffCohorts()); Expect.Call(staffCustomStudentListRepository.GetAll()).Repeat.Any().Return(GetStaffCustomStudentLists()); Expect.Call(staffCustomStudentListStudentRepository.GetAll()).Repeat.Any().Return(GetStaffCustomStudentListStudents()); Expect.Call(metadataListIdResolver.GetListId(ListType.StudentDemographic, SchoolCategory.HighSchool)).Return(suppliedMetadataListId); Expect.Call(listMetadataProvider.GetListMetadata(suppliedMetadataListId)).Return(suppliedMetadataColumnGroupList); Expect.Call(studentListWithMetricsProvider.GetOrderedStudentList(null)) .Repeat.Any() .IgnoreArguments() .Return(GetStudentList()); Expect.Call(studentListWithMetricsProvider.GetStudentsWithMetrics(null)) .Repeat.Any() .IgnoreArguments() .Return(new List<StudentMetric>().AsQueryable()); Expect.Call(gradeLevelUtilitiesProvider.FormatGradeLevelForSorting("1")).IgnoreArguments().Repeat.Any().Return(1); Expect.Call(gradeLevelUtilitiesProvider.FormatGradeLevelForDisplay("1")).IgnoreArguments().Repeat.Any().Return("1"); Expect.Call(classroomMetricsProvider.GetAdditionalMetrics(null, null)).IgnoreArguments().Repeat.Any().Return(suppliedAdditionalMetrics); 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>>(); metricComponentRepository = mocks.StrictMock<IRepository<MetricComponent>>(); studentSchoolMetricInstanceSetRepository = mocks.StrictMock<IRepository<StudentSchoolMetricInstanceSet>>(); studentRecordCurrentCourseRepository = mocks.StrictMock<IRepository<StudentRecordCurrentCourse>>(); metricRepository = mocks.StrictMock<IRepository<Dashboards.Metric.Data.Entities.Metric>>(); schoolCategoryProvider = mocks.StrictMock<ISchoolCategoryProvider>(); accommodationProvider = mocks.StrictMock<IAccommodationProvider>(); uniqueListProvider = mocks.StrictMock<IUniqueListIdProvider>(); trendRenderingDispositionProvider = mocks.StrictMock<ITrendRenderingDispositionProvider>(); gradeStateProvider = mocks.StrictMock<IGradeStateProvider>(); rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>(); metricStateProvider = mocks.StrictMock<IMetricStateProvider>(); classroomMetricsProvider = mocks.StrictMock<IClassroomMetricsProvider>(); studentListUtilitiesProvider = mocks.StrictMock<IStudentListUtilitiesProvider>(); metadataListIdResolver = mocks.StrictMock<IMetadataListIdResolver>(); listMetadataProvider = mocks.StrictMock<IListMetadataProvider>(); subjectSpecificOverviewMetricComponentProvider = mocks.StrictMock<ISubjectSpecificOverviewMetricComponentProvider>(); studentListWithMetricsProvider = mocks.StrictMock<IStudentMetricsProvider>(); gradeLevelUtilitiesProvider = mocks.StrictMock<IGradeLevelUtilitiesProvider>(); 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(metricComponentRepository.GetAll()).Repeat.Any().Return(GetSuppliedMetricComponent()); Expect.Call(studentSchoolMetricInstanceSetRepository.GetAll()).Repeat.Any().Return(GetSuppliedStudentSchoolMetricInstanceSet()); Expect.Call(studentRecordCurrentCourseRepository.GetAll()).Repeat.Any().Return(GetSuppliedStudentRecordCurrentCourse()); Expect.Call(metricRepository.GetAll()).Repeat.Any().Return(GetMetric()); Expect.Call(uniqueListProvider.GetUniqueId()).Repeat.Twice().Return(suppliedUniqueListId); Expect.Call(gradeStateProvider.Get(0)).IgnoreArguments().Repeat.Any().Return(MetricStateType.Acceptable); Expect.Call(gradeStateProvider.Get("A")).IgnoreArguments().Repeat.Any().Return(MetricStateType.Acceptable); Expect.Call(metricStateProvider.GetState(0, String.Empty, String.Empty)).IgnoreArguments().Repeat.Any().Return(new State(MetricStateType.Good, "Good")); Expect.Call(trendRenderingDispositionProvider.GetTrendRenderingDisposition(TrendDirection.Increasing, TrendInterpretation.Standard)).Repeat.Any().Return(TrendEvaluation.UpGood); Expect.Call(trendRenderingDispositionProvider.GetTrendRenderingDisposition(TrendDirection.Decreasing, TrendInterpretation.Standard)).Repeat.Any().Return(TrendEvaluation.DownBad); Expect.Call(rootMetricNodeResolver.GetRootMetricNodeForStudent(suppliedSchoolId)).Repeat.Any().Return(GetStudentRootOverviewNode()); foreach (var studentId in expectedStudentIds) Expect.Call(classroomMetricsProvider.GetAdditionalMetrics(null, null)).IgnoreArguments().Constraints(Property.Value("StudentUSI", studentId), Rhino.Mocks.Constraints.Is.Anything()).Repeat.Any().Return(GetSuppliedMetrics()); //Tested Elsewhere. Expect.Call(metadataListIdResolver.GetListId(ListType.ClassroomSubjectSpecific, SchoolCategory.HighSchool, "subjectArea")).IgnoreArguments().Repeat.Any().Return(1); Expect.Call(listMetadataProvider.GetListMetadata(1, "subjectArea")).IgnoreArguments().Repeat.Any().Return(GetSuppliedListMetadata()); Expect.Call(studentListUtilitiesProvider.PrepareMetric(1, 1, 1, "1", 1, "1", "1")).IgnoreArguments().Repeat.Any().Return(FakeMetric()); Expect.Call(studentListUtilitiesProvider.PrepareTrendMetric(1, 1, 1, "1", 1, "1", "1", 1, 1, null)).IgnoreArguments().Repeat.Any().Return(FakeTrendMetric()); Expect.Call(subjectSpecificOverviewMetricComponentProvider.GetMetricIdsForComponents()).Return(new int[] { (int)StudentMetricEnum.AbsenceLevelCurrentPeriod, (int)StudentMetricEnum.ClassGradeGradesFalling10PercentOrMore }); Expect.Call(studentListWithMetricsProvider.GetOrderedStudentList(GetStudentListWithMetricsQueryOptions())).IgnoreArguments().Repeat.Any().Return(GetStudentListData(suppliedStudentListType)); Expect.Call(gradeLevelUtilitiesProvider.FormatGradeLevelForSorting("1")).IgnoreArguments().Repeat.AtLeastOnce().Return(1); Expect.Call(studentListWithMetricsProvider.GetStudentsWithMetrics(GetStudentListWithMetricsQueryOptions())).IgnoreArguments().Repeat.Any().Return(GetStudentListWithMetricsData(suppliedStudentListType)); Expect.Call(gradeLevelUtilitiesProvider.FormatGradeLevelForDisplay(null)).Repeat.Any().Return(string.Empty); base.EstablishContext(); }
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(); }
public SessionStudentListController(ISessionStateProvider session, IUniqueListIdProvider uniqueListProvider) { this.session = session; this.uniqueListProvider = uniqueListProvider; }
public PreviousNextSessionProvider(ISessionStateProvider sessionStateProvider, IUniqueListIdProvider uniqueListProvider) { this.sessionStateProvider = sessionStateProvider; this.uniqueListProvider = uniqueListProvider; }
protected override void EstablishContext() { enhancedStudentInformationRepository = mocks.StrictMock<IRepository<EnhancedStudentInformation>>(); teacherStudentSectionRepository = mocks.StrictMock<IRepository<TeacherStudentSection>>(); teacherSectionRepository = mocks.StrictMock<IRepository<TeacherSection>>(); staffStudentCohortRepository = mocks.StrictMock<IRepository<StaffStudentCohort>>(); staffCohortRepository = mocks.StrictMock<IRepository<StaffCohort>>(); staffCustomStudentListStudentRepository = mocks.StrictMock<IRepository<StaffCustomStudentListStudent>>(); staffCustomStudentListRepository = mocks.StrictMock<IRepository<StaffCustomStudentList>>(); accommodationProvider = mocks.StrictMock<IAccommodationProvider>(); uniqueListIdProvider = mocks.StrictMock<IUniqueListIdProvider>(); trendRenderingDispositionProvider = mocks.StrictMock<ITrendRenderingDispositionProvider>(); rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>(); metricStateProvider = mocks.StrictMock<IMetricStateProvider>(); studentMetricObjectiveRepository = mocks.StrictMock<IRepository<StudentMetricObjective>>(); assessmentDetailsProvider = mocks.StrictMock<IAssessmentDetailsProvider>(); assessmentBenchmarkDetailsProvider = mocks.StrictMock<IAssessmentBenchmarkDetailsProvider>(); studentMetricsProvider = mocks.StrictMock<IStudentMetricsProvider>(); schoolCategoryProvider = mocks.StrictMock<ISchoolCategoryProvider>(); metadataListIdResolver = mocks.StrictMock<IMetadataListIdResolver>(); listMetadataProvider = mocks.StrictMock<IListMetadataProvider>(); classroomMetricsProvider = mocks.StrictMock<IClassroomMetricsProvider>(); gradeLevelUtilitiesProvider = mocks.StrictMock<IGradeLevelUtilitiesProvider>(); Expect.Call(studentMetricObjectiveRepository.GetAll()).Return(GetSuppliedStudentMetricObjective()); 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(new List<StaffCustomStudentList>().AsQueryable() ); Expect.Call(staffCustomStudentListStudentRepository.GetAll()).Repeat.Any().Return(new List<StaffCustomStudentListStudent>().AsQueryable()); Expect.Call(studentMetricsProvider.GetOrderedStudentList(null, null, null)).IgnoreArguments().Return(SuppliedStudentList.AsQueryable().Where(x => x.SchoolId == suppliedSchoolId && expectedStudentIds.Contains(x.StudentUSI))); Expect.Call(studentMetricsProvider.GetStudentsWithMetrics(null)).IgnoreArguments().Return(SuppliedStudentMetrics.AsQueryable()); Expect.Call(schoolCategoryProvider.GetSchoolCategoryType(suppliedSchoolId)).Return(SchoolCategory.HighSchool); Expect.Call(uniqueListIdProvider.GetUniqueId()).Return(suppliedUniqueListId); Expect.Call(metadataListIdResolver.GetListId(ListType.ClassroomGeneralOverview, SchoolCategory.HighSchool)).Return(0); Expect.Call(rootMetricNodeResolver.GetRootMetricNodeForStudent(suppliedSchoolId)).Repeat.Any().Return(GetStudentRootOverviewNode()); Expect.Call(listMetadataProvider.GetListMetadata(0)).Return(new List<MetadataColumnGroup>()); Expect.Call(assessmentDetailsProvider.GetStudentsFixedRowTitle(suppliedAssessmentSubType, suppliedSubjectArea)).Return(string.Empty); Expect.Call(gradeLevelUtilitiesProvider.FormatGradeLevelForSorting(null)).IgnoreArguments().Return(23).Repeat.Times(expectedStudentIds.Count); Expect.Call(gradeLevelUtilitiesProvider.FormatGradeLevelForDisplay(null)).IgnoreArguments().Return("Formatted").Repeat.Times(expectedStudentIds.Count); Expect.Call(classroomMetricsProvider.GetAdditionalMetrics(null, null)).IgnoreArguments() .Do(new Func<IEnumerable<StudentMetric>, List<MetadataColumnGroup>, List<StudentWithMetrics.Metric>>((arg1, arg2) => new List<StudentWithMetrics.Metric>())) .Repeat.Times(expectedStudentIds.Count); Expect.Call(assessmentBenchmarkDetailsProvider.GetObjectiveColumnWidth()).Return(string.Empty).Repeat.Times(expectedObjectiveTitleCount); Expect.Call(assessmentBenchmarkDetailsProvider.GetMetricIdsForObjectives(suppliedSubjectArea)).Return(new[] { requestedMetricId }).Repeat.Times(1); Expect.Call(assessmentBenchmarkDetailsProvider.OnStudentAssessmentInitialized(null, null, StaffModel.SubjectArea.None)).IgnoreArguments() .Return(new StudentWithMetrics.IndicatorMetric { MetricVariantId = requestedMetricId, MetricIndicator = 1, StudentUSI = 1, UniqueIdentifier = 1, DisplayValue = "some value", State = MetricStateType.Good, Value = "some other value", }) .Repeat.Times(expectedStudentIds.Count); 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>>(); 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() { 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); }