protected override void EstablishContext()
        {
            staffCohortRepository = mocks.StrictMock<IRepository<StaffCohort>>();
            staffStudentCohortRepository = mocks.StrictMock<IRepository<StaffStudentCohort>>();
            staffCustomStudentListRepository = mocks.StrictMock<IRepository<StaffCustomStudentList>>();
            staffCustomStudentListStudentRepository = mocks.StrictMock<IRepository<StaffCustomStudentListStudent>>();
            schoolInformationRepository = mocks.StrictMock<IRepository<SchoolInformation>>();
            studentInformationRepository = mocks.StrictMock<IRepository<StudentInformation>>();
            studentSchoolInformationRepository = mocks.StrictMock<IRepository<StudentSchoolInformation>>();
            studentIndicatorRepository = mocks.StrictMock<IRepository<StudentIndicator>>();
            metricInstanceRepository = mocks.StrictMock<IRepository<MetricInstance>>();
            studentSchoolMetricInstanceSetRepository = mocks.StrictMock<IRepository<StudentSchoolMetricInstanceSet>>();
            rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>();
            gradeLevelUtilitiesProvider = new GradeLevelUtilitiesProvider();

            Expect.Call(staffCohortRepository.GetAll()).Repeat.Any().Return(GetStaffCohortRepositoryInformation());
            Expect.Call(staffStudentCohortRepository.GetAll()).Repeat.Any().Return(GetStaffStudentCohortRepositoryInformation());
            Expect.Call(staffCustomStudentListRepository.GetAll()).Repeat.Any().Return(GetStaffCustomStudentListRepositoryInformation());
            Expect.Call(staffCustomStudentListStudentRepository.GetAll()).Repeat.Any().Return(GetStaffCustomStudentListStudentRepositoryInformation());
            Expect.Call(schoolInformationRepository.GetAll()).Repeat.Any().Return(GetSchoolInformation());
            Expect.Call(studentInformationRepository.GetAll()).Repeat.Any().Return(GetStudentInformation());
            Expect.Call(studentSchoolInformationRepository.GetAll()).Repeat.Any().Return(GetStudentSchoolInformation());
            Expect.Call(metricInstanceRepository.GetAll()).Return(GetMetricInstance());
            Expect.Call(studentSchoolMetricInstanceSetRepository.GetAll()).Return(GetStudentSchoolMetricInstanceSet());

            Expect.Call(rootMetricNodeResolver.GetRootMetricNodeForStudent(suppliedSchoolId1)).Repeat.Any().Return(GetSuppliedMetadataHierarchy().Children.First());

            base.EstablishContext();
        }
        protected override void EstablishContext()
        {
            //Prepare supplied data collections
            suppliedStudentInformationData = GetSuppliedStudentInformation();
            suppliedRootMetricNode = GetSuppliedRootNode();
            suppliedRootMetricHierarchy = GetSuppliedRootMetricHierarchy();
            suppliedRootIEnumerableOfKeyValuePair = GetSuppliedRootKeyValuePairs();

            //Set up the mocks
            studentInformationRepository = mocks.StrictMock<IRepository<StudentInformation>>();
            rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>();
            domainMetricService = mocks.StrictMock<IDomainMetricService<StudentSchoolMetricInstanceSetRequest>>();
            metricTreeToIEnumerableOfKeyValuePairProvider = mocks.StrictMock<IMetricTreeToIEnumerableOfKeyValuePairProvider>();

            //Set expectations
            Expect.Call(studentInformationRepository.GetAll()).Return(suppliedStudentInformationData);
            Expect.Call(rootMetricNodeResolver.GetRootMetricNode()).Return(suppliedRootMetricNode);

            Expect.Call(domainMetricService.Get(null))
                .Constraints(
                    new ActionConstraint<StudentSchoolMetricInstanceSetRequest>(x =>
                    {
                        Assert.That(x.SchoolId == suppliedSchoolId);
                        Assert.That(x.StudentUSI == suppliedStudentUSI);
                        Assert.That(x.MetricVariantId == suppliedRootMetricNode.MetricVariantId);
                    })
                ).Return(suppliedRootMetricHierarchy);
            Expect.Call(metricTreeToIEnumerableOfKeyValuePairProvider.FlattenMetricTree((ContainerMetric) suppliedRootMetricHierarchy.RootNode)).Return(suppliedRootIEnumerableOfKeyValuePair);
        }
 public DomainSpecificMetricNodeResolver(IEdFiDashboardContextProvider dashboardContextProvider,
     IMetricMetadataTreeService metricMetadataTreeService,
     IRootMetricNodeResolver rootMetricNodeResolver)
 {
     this.dashboardContextProvider = dashboardContextProvider;
     this.metricMetadataTreeService = metricMetadataTreeService;
     this.rootMetricNodeResolver = rootMetricNodeResolver;
 }
 public StudentSchoolLayoutController(
     IRootMetricNodeResolver rootMetricNodeResolver,
     IService<BriefRequest, BriefModel> studentBriefService,
     IService<ResourcesRequest, IEnumerable<ResourceModel>> studentSchoolMenuResourceRequestService)
 {
     this.rootMetricNodeResolver = rootMetricNodeResolver;
     this.studentBriefService = studentBriefService;
     this.studentSchoolMenuResourceRequestService = studentSchoolMenuResourceRequestService;
 }
 public LocalEducationAgencyLayoutController(IService<BriefRequest, BriefModel> localEducationAgencyBriefService,
     IRootMetricNodeResolver rootMetricNodeResolver,
     IDomainSpecificMetricNodeResolver domainSpecificMetricNodeResolver,
     IService<ResourcesRequest, IEnumerable<ResourceModel>> localEducationAgencyMenuResourceRequestService)
 {
     this.localEducationAgencyBriefService = localEducationAgencyBriefService;
     this.rootMetricNodeResolver = rootMetricNodeResolver;
     this.domainSpecificMetricNodeResolver = domainSpecificMetricNodeResolver;
     this.localEducationAgencyMenuResourceRequestService = localEducationAgencyMenuResourceRequestService;
 }
        protected override void EstablishContext()
        {
            //Prepare supplied data collections

            //Set up the mocks
            rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>();

            //Set expectations
            Expect.Call(rootMetricNodeResolver.GetRootMetricNodeForLocalEducationAgency()).Return(GetLEARootOverviewNode());
            Expect.Call(rootMetricNodeResolver.GetRootMetricNodeForSchool(suppliedSchoolId)).Return(GetSchoolRootOverviewNode());
        }
 public SchoolLayoutController(IService<BriefRequest, BriefModel> schoolBriefService,
     IRootMetricNodeResolver rootMetricNodeResolver,
     IDomainSpecificMetricNodeResolver domainSpecificMetricNodeResolver,
     ISchoolAreaLinks schoolLinks,
     IService<ResourcesRequest, IEnumerable<ResourceModel>> schoolMenuResourceRequestService)
 {
     this.schoolBriefService = schoolBriefService;
     this.rootMetricNodeResolver = rootMetricNodeResolver;
     this.domainSpecificMetricNodeResolver = domainSpecificMetricNodeResolver;
     this.schoolLinks = schoolLinks;
     this.schoolMenuResourceRequestService = schoolMenuResourceRequestService;
 }
        protected override void EstablishContext()
        {
            //Prepare supplied data collections
            suppliedMetadataTree = GetSuppliedMetricMetadataTree();

            //Set up the mocks
            dashboardContextProvider = mocks.StrictMock<IEdFiDashboardContextProvider>();
            metricMetadataTreeService = mocks.StrictMock<IMetricMetadataTreeService>();
            rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>();

            //Set expectations
            Expect.Call(metricMetadataTreeService.Get(null)).IgnoreArguments().Return(suppliedMetadataTree);
        }
Example #9
0
        protected override void EstablishContext()
        {
            base.EstablishContext();

            staffStudentAssociationRepository = mocks.StrictMock<IRepository<StaffStudentAssociation>>();
            rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>();
            currentUserClaimInterrogator = mocks.StrictMock<ICurrentUserClaimInterrogator>();

            windsorContainer = new WindsorContainer();
            RegisterProviders(windsorContainer);

            userEntryProvider = windsorContainer.Resolve<IUserEntryProvider>();

            Expect.Call(staffStudentAssociationRepository.GetAll()).Repeat.Any().Return(GetStaffStudentAssociations());
            Expect.Call(rootMetricNodeResolver.GetRootMetricNodeForSchool(suppliedSchoolId)).Repeat.Any().Return(new MetricMetadataNode (new TestMetricMetadataTree()) {MetricId = suppliedMetricId});

            Thread.CurrentPrincipal = suppliedUserInformation.ToClaimsPrincipal();
        }
        protected override void EstablishContext()
        {
            schoolInformationRepository = mocks.StrictMock<IRepository<SchoolInformation>>();
            studentInformationRepository = mocks.StrictMock<IRepository<StudentInformation>>();
            studentSchoolInformationRepository = mocks.StrictMock<IRepository<StudentSchoolInformation>>();
            metricInstanceRepository = mocks.StrictMock<IRepository<MetricInstance>>();
            studentSchoolMetricInstanceSetRepository = mocks.StrictMock<IRepository<StudentSchoolMetricInstanceSet>>();
            rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>();
            gradeLevelUtilitiesProvider = mocks.StrictMock<IGradeLevelUtilitiesProvider>();

            Expect.Call(schoolInformationRepository.GetAll()).Repeat.Any().Return(GetSchoolInformation());
            Expect.Call(studentInformationRepository.GetAll()).Repeat.Any().Return(GetStudentInformation());
            Expect.Call(studentSchoolInformationRepository.GetAll()).Repeat.Any().Return(GetStudentSchoolInformation());
            Expect.Call(metricInstanceRepository.GetAll()).Return(GetMetricInstance());
            Expect.Call(studentSchoolMetricInstanceSetRepository.GetAll()).Return(GetStudentSchoolMetricInstanceSet());

            Expect.Call(gradeLevelUtilitiesProvider.FormatGradeLevelForDisplay(null)).Return("");

            base.EstablishContext();
        }
        protected override void EstablishContext()
        {
            //Prepare supplied data collections
            suppliedStudentInformationData = GetSuppliedStudentInformation();
            suppliedStudentSchoolMetricInstanceSetData = GetSuppliedStudentSchoolMetricInstanceSet();
            suppliedMetricInstanceData = GetSuppliedMetricInstance();
            suppliedMetricHierarchy = GetSuppliedMetadataHierarchy();

            //Set up the mocks
            studentInformationRepository = mocks.StrictMock<IRepository<StudentInformation>>();
            StudentSchoolMetricInstanceSetRepository = mocks.StrictMock<IRepository<StudentSchoolMetricInstanceSet>>();
            metricInstanceRepository = mocks.StrictMock<IRepository<MetricInstance>>();
            rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>();

            //Set expectations
            Expect.Call(studentInformationRepository.GetAll()).Return(suppliedStudentInformationData);
            Expect.Call(StudentSchoolMetricInstanceSetRepository.GetAll()).Return(suppliedStudentSchoolMetricInstanceSetData);
            Expect.Call(metricInstanceRepository.GetAll()).Return(suppliedMetricInstanceData);
            Expect.Call(rootMetricNodeResolver.GetRootMetricNodeForStudent(suppliedSchoolId)).Return(suppliedMetricHierarchy.Children.First());
        }
        protected override void EstablishContext()
        {
            InitializeSuppliedData();

            //Set up the mocks
            localEducationAgencyInformationRepository = mocks.StrictMock<IRepository<LocalEducationAgencyInformation>>();
            domainMetricService = mocks.StrictMock<IDomainMetricService<LocalEducationAgencyMetricInstanceSetRequest>>();
            rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>();
            metricTreeToIEnumerableOfKeyValuePairProvider = mocks.StrictMock<IMetricTreeToIEnumerableOfKeyValuePairProvider>();
            domainSpecificMetricNodeResolver = mocks.StrictMock<IDomainSpecificMetricNodeResolver>();
    
            //Set expectations
            Expect.Call(localEducationAgencyInformationRepository.GetAll()).Return(suppliedLocalEducationAgencyInformationData);
            
            Expect.Call(rootMetricNodeResolver.GetRootMetricNode()).Return(suppliedRootMetricNode);

            Expect.Call(domainMetricService.Get(null))
                .Constraints(
                    new ActionConstraint<LocalEducationAgencyMetricInstanceSetRequest>(x =>
                    {
                        Assert.That(x.LocalEducationAgencyId == suppliedLocalEducationAgencyId);
                        Assert.That(x.MetricVariantId == suppliedRootMetricVariantId);
                    })
                ).Return(suppliedRootMetricHierarchy);

            Expect.Call(metricTreeToIEnumerableOfKeyValuePairProvider.FlattenMetricTree((ContainerMetric)suppliedRootMetricHierarchy.RootNode)).Return(suppliedRootIEnumerableOfKeyValuePair);

            Expect.Call(domainSpecificMetricNodeResolver.GetOperationalDashboardMetricNode()).Return(suppliedOperationalDashboardMetricNode);

            // Mock the metric service call to obtain operational dashboards
            Expect.Call(domainMetricService.Get(null))
                .Constraints(
                    new ActionConstraint<LocalEducationAgencyMetricInstanceSetRequest>(x =>
                    {
                        Assert.That(x.LocalEducationAgencyId == suppliedLocalEducationAgencyId);
                        Assert.That(x.MetricVariantId == suppliedOperationalDashboardMetricVariantId);
                    })
                ).Return(suppliedOperationalDashboardMetricHierarchy);

            MockFlatteningOfOperationDashboardsHierarchy();
        }
        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()
        {
            schoolInformationRepository = mocks.StrictMock<IRepository<SchoolInformation>>();
            studentInformationRepository = mocks.StrictMock<IRepository<StudentInformation>>();
            studentSchoolInformationRepository = mocks.StrictMock<IRepository<StudentSchoolInformation>>();
            studentIndicatorRepository = mocks.StrictMock<IRepository<StudentIndicator>>();
            metricInstanceRepository = mocks.StrictMock<IRepository<MetricInstance>>();
            studentSchoolMetricInstanceSetRepository = mocks.StrictMock<IRepository<StudentSchoolMetricInstanceSet>>();
            rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>();
            gradeLevelUtilitiesProvider = mocks.StrictMock<IGradeLevelUtilitiesProvider>();

            Expect.Call(schoolInformationRepository.GetAll()).Repeat.Any().Return(GetSchoolInformation());
            Expect.Call(studentInformationRepository.GetAll()).Repeat.Any().Return(GetStudentInformation());
            Expect.Call(studentSchoolInformationRepository.GetAll()).Repeat.Any().Return(GetStudentSchoolInformation());
            if (expectStudentInformationQuery)
                Expect.Call(studentIndicatorRepository.GetAll()).Repeat.Any().Return(GetStudentIndicator());
            Expect.Call(metricInstanceRepository.GetAll()).Return(GetMetricInstance());
            Expect.Call(studentSchoolMetricInstanceSetRepository.GetAll()).Return(GetStudentSchoolMetricInstanceSet());

            Expect.Call(rootMetricNodeResolver.GetRootMetricNodeForStudent(suppliedSchoolId1)).Repeat.Any().Return(GetSuppliedMetadataHierarchy().Children.First());
            Expect.Call(gradeLevelUtilitiesProvider.FormatGradeLevelForDisplay(null)).Return("");

            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();
        }
Example #16
0
 public QuickSearchController(IService<QuickSearchRequest, QuickSearchModel> service, IRootMetricNodeResolver rootMetricNodeResolver, IStudentSchoolAreaLinks studentSchoolLinks, ICurrentUserClaimInterrogator currentUserClaimInterrogator)
 {
     this.service = service;
     this.rootMetricNodeResolver = rootMetricNodeResolver;
     this.studentSchoolLinks = studentSchoolLinks;
 }
        protected override void EstablishContext()
        {
            //studentListWithMetricsRepository = mocks.StrictMock<IRepository<StudentList>>();
            //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>();
            trendRenderingDispositionProvider = mocks.StrictMock<ITrendRenderingDispositionProvider>();
            rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>();
            metricStateProvider = mocks.StrictMock<IMetricStateProvider>();
            listMetadataProvider = mocks.StrictMock<IListMetadataProvider>();
            classroomMetricsProvider = mocks.StrictMock<IClassroomMetricsProvider>();
            metadataListIdResolver = mocks.StrictMock<IMetadataListIdResolver>();
            studentListWithMetricsProvider = mocks.StrictMock<IStudentMetricsProvider>();
            gradeLevelUtilitiesProvider = mocks.StrictMock<IGradeLevelUtilitiesProvider>();
            watchListManager = mocks.StrictMock<IStudentWatchListManager>();

            //Expect.Call(studentListWithMetricsRepository.GetAll()).Return(GetSuppliedStudentListWithMetrics());
            //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(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(studentListWithMetricsProvider.GetOrderedStudentList(GetStudentListWithMetricsQueryOptions(suppliedStudentListType))).IgnoreArguments().Repeat.Any().Return(GetStudentSectionEntityListData(suppliedStudentListType));
            Expect.Call(studentListWithMetricsProvider.GetStudentsWithMetrics(GetStudentListWithMetricsQueryOptions(suppliedStudentListType))).IgnoreArguments().Repeat.Any().Return(GetStudentListSectionPageDataData(suppliedStudentListType));
            Expect.Call(gradeLevelUtilitiesProvider.FormatGradeLevelForDisplay("1")).IgnoreArguments().Repeat.AtLeastOnce().Return("");
            Expect.Call(gradeLevelUtilitiesProvider.FormatGradeLevelForSorting("1")).IgnoreArguments().Repeat.AtLeastOnce().Return(1);
            Expect.Call(watchListManager.CreateStudentMetricsProviderQueryOptions(null, null, 3, 3, null, null, null, StudentListType.All))
                .IgnoreArguments().Repeat.Any().Return(new StudentMetricsProviderQueryOptions());

            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()
        {
            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();
        }
Example #20
0
        protected override void EstablishContext()
        {
            base.EstablishContext();

            staffStudentAssociationRepository = mocks.StrictMock<IRepository<StaffStudentAssociation>>();
            rootMetricNodeResolver = mocks.StrictMock<IRootMetricNodeResolver>();
            currentUserClaimInterrogator = mocks.StrictMock<ICurrentUserClaimInterrogator>();
            windsorContainer = new WindsorContainer();
            RegisterProviders(windsorContainer);

            userEntryProvider = windsorContainer.Resolve<IUserEntryProvider>();

            var suppliedUserInformation = new UserInformation
                                                {
                                                    StaffUSI = suppliedStaffUSI,
                                                    AssociatedOrganizations = new List<UserInformation.EducationOrganization>()
                                                                                {
                                                                                    new UserInformation.School(suppliedLocalEducationAgencyId, suppliedSchoolId)
                                                                                        {
                                                                                            ClaimTypes = new List<string>
                                                                                                                {
                                                                                                                    EdFiClaimTypes.ViewAllTeachers
                                                                                                                }
                                                                                        }
                                                                                }
                                                };
            Thread.CurrentPrincipal = suppliedUserInformation.ToClaimsPrincipal();
        }
 public MetricCorrelationProvider(IRootMetricNodeResolver rootMetricNodeResolver)
 {
     this.rootMetricNodeResolver = rootMetricNodeResolver;
 }
        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();
        }