public void ShouldRetrieveSchoolCount()
        {
            var elementarySchoolCategoryDescriptorId = GetNewSchoolCategoryDescriptorId("Elementary School");
            var highSchoolCategoryDescriptorId       = GetNewSchoolCategoryDescriptorId("High School");
            var middleSchoolCategoryDescriptorId     = GetNewSchoolCategoryDescriptorId("Middle School");

            var localEducationAgencyId = GetNewLocalEducationAgencyId();
            var newHighSchoolId        = GetNewSchool(localEducationAgencyId);

            SetSchoolCategoryDescriptor(newHighSchoolId, highSchoolCategoryDescriptorId);

            var newMiddleSchoolId1 = GetNewSchool(localEducationAgencyId);
            var newMiddleSchoolId2 = GetNewSchool(localEducationAgencyId);

            SetSchoolCategoryDescriptor(newMiddleSchoolId1, middleSchoolCategoryDescriptorId);
            SetSchoolCategoryDescriptor(newMiddleSchoolId2, middleSchoolCategoryDescriptorId);

            var newElementarySchoolId1 = GetNewSchool(localEducationAgencyId);
            var newElementarySchoolId2 = GetNewSchool(localEducationAgencyId);
            var newElementarySchoolId3 = GetNewSchool(localEducationAgencyId);

            SetSchoolCategoryDescriptor(newElementarySchoolId1, elementarySchoolCategoryDescriptorId);
            SetSchoolCategoryDescriptor(newElementarySchoolId2, elementarySchoolCategoryDescriptorId);
            SetSchoolCategoryDescriptor(newElementarySchoolId3, elementarySchoolCategoryDescriptorId);

            var otherLocalAgencyId      = GetNewLocalEducationAgencyId();
            var otherHighSchoolId       = GetNewSchool(otherLocalAgencyId);
            var otherMiddleSchoolId     = GetNewSchool(otherLocalAgencyId);
            var otherElementarySchoolId = GetNewSchool(otherLocalAgencyId);

            SetSchoolCategoryDescriptor(otherHighSchoolId, highSchoolCategoryDescriptorId);
            SetSchoolCategoryDescriptor(otherMiddleSchoolId, middleSchoolCategoryDescriptorId);
            SetSchoolCategoryDescriptor(otherElementarySchoolId, elementarySchoolCategoryDescriptorId);

            var report = new GetSchoolsBySchoolTypeQuery(TestConnectionProvider);
            var result = report.Execute(CloudOdsDatabaseNames.ProductionOds, ApiMode.Sandbox, localEducationAgencyId);

            result.SchoolCounts.Count.ShouldBe(3);
            result.SchoolCounts.Single(c => c.Description == "High School").Count.ShouldBe(1);
            result.SchoolCounts.Single(c => c.Description == "Middle School").Count.ShouldBe(2);
            result.SchoolCounts.Single(c => c.Description == "Elementary School").Count.ShouldBe(3);
        }
コード例 #2
0
 public ReportsController(GetAllLocalEducationAgenciesQuery getAllLocalEducationAgenciesQuery
                          , StudentsByProgramQuery studentsByProgramQuery
                          , StudentEconomicSituationReportQuery studentEconomicSituationReportQuery
                          , TotalEnrollmentQuery totalEnrollmentQuery
                          , GetSchoolsBySchoolTypeQuery getSchoolsBySchoolTypeQuery
                          , StudentEnrollmentByGenderQuery studentEnrollmentByGenderQuery
                          , StudentEnrollmentByRaceQuery studentEnrollmentByRaceQuery
                          , StudentEnrollmentByEthnicityQuery studentEnrollmentByEthnicityQuery
                          , InstanceContext instanceContext)
 {
     _getAllLocalEducationAgenciesQuery   = getAllLocalEducationAgenciesQuery;
     _studentsByProgramQuery              = studentsByProgramQuery;
     _studentEconomicSituationReportQuery = studentEconomicSituationReportQuery;
     _totalEnrollmentQuery              = totalEnrollmentQuery;
     _getSchoolsBySchoolTypeQuery       = getSchoolsBySchoolTypeQuery;
     _studentEnrollmentByGenderQuery    = studentEnrollmentByGenderQuery;
     _studentEnrollmentByRaceQuery      = studentEnrollmentByRaceQuery;
     _studentEnrollmentByEthnicityQuery = studentEnrollmentByEthnicityQuery;
     _instanceContext = instanceContext;
 }