Exemple #1
0
        public void GetSections_All_Success()
        {
            int count = TestHelper.GetSectionCountWithFilter(new AvailabilityFacet(AvailabilityFacet.Options.All));

            int allSectionCount = _dataVerifier.GetSectionCount("ClassID = ClassID");

            Assert.AreEqual(allSectionCount, count);
        }
        public void GetSections_Verify_IsVariableCredits_Flag()
        {
            IList <Section> sections = TestHelper.GetSectionsWithFilter(new YearQuarterFacet(YearQuarter.FromString("B123")), false);
//          IList<Section> engl = sections.Where(s => s.CourseSubject.ToUpper() == "ENGL" && s.CourseNumber == "299").ToList();

            int actual = sections.Where(s => s.IsVariableCredits).Count();

            int expected = _dataVerifier.GetSectionCount("isnull(VariableCredits, 0) <> 0 and YearQuarterID = 'B123'");

            Assert.AreEqual(expected, actual);
        }
        public void GetSections_OneQuarter_Success()
        {
            IList <YearQuarter> yearQuartersToFilter = new List <YearQuarter>();

//          yearQuartersToFilter.Add(YearQuarter.FromString("B121"));
            yearQuartersToFilter.Add(TestHelper.Data.YearQuarterWithSections);

            int returnedCount = TestHelper.GetSectionCountWithFilter(new YearQuarterFacet(yearQuartersToFilter), false);
            int actualCount   = _dataVerifier.GetSectionCount(string.Format("YearQuarterID = '{0}'", yearQuartersToFilter[0].ID));

            Assert.AreEqual(actualCount, returnedCount);
        }
        public void GetSections_Days_MTWThF_Success()
        {
            int count = TestHelper.GetSectionCountWithFilter(new DaysFacet(DaysFacet.Options.Monday | DaysFacet.Options.Tuesday | DaysFacet.Options.Wednesday | DaysFacet.Options.Thursday | DaysFacet.Options.Friday));

            int allSectionCount = _dataVerifier.AllSectionsCount;

            Assert.IsTrue(allSectionCount > count);

            int expectedCount = _dataVerifier.GetSectionCount("ClassID in (select i.ClassID from vw_Instruction i where i.ClassID = ClassID and i.DayID in (select d.DayID from vw_Day d where d.Title = 'MTWThF' or d.Title = 'DAILY'))");

            Assert.AreEqual(expectedCount, count);
        }
Exemple #5
0
        public void ForCourseID_CurrentRegistrationQuarter()
        {
            using (OdsRepository repository = new OdsRepository())
            {
                ICourseID   courseID = CourseID.FromString("ACCT 101");
                YearQuarter yrq      = repository.CurrentRegistrationQuarter;

                int sectionCount = repository.SectionCountForCourse(courseID, yrq, TestHelper.GetFacets(false));
                Assert.IsTrue(sectionCount > 0, string.Format("No sections found for '{0}' in '{1}'", courseID, yrq.FriendlyName));

                int expectedCount = _dataVerifier.GetSectionCount(string.Format("YearQuarterID = '{0}' AND CourseID LIKE '{1}%{2}' AND NOT CourseID LIKE '%&%'", yrq, courseID.Subject, courseID.Number));
                Assert.AreEqual(expectedCount, sectionCount);
            }
        }
Exemple #6
0
        public void GetSections_CurrentAnd3PreviousQuarters_Success()
        {
            int count = TestHelper.GetSectionCountWithFilter(new RegistrationQuartersFacet(-4), false);

            int allSectionCount = _dataVerifier.GetSectionCount("ClassID = ClassID");

            Assert.AreEqual(allSectionCount, count);
        }
Exemple #7
0
        public void GetSections_LateStart_Success()
        {
            ApiSettings settings  = (ApiSettings)ConfigurationManager.GetSection(ApiSettings.SectionName);
            ushort      daysCount = settings.ClassFlags.LateStartDaysCount;

            string whereClause = String.Format("NOT StartDate IS NULL AND dateadd(day, -{0}, StartDate) >= (select top 1 yq.FirstClassDay from vw_YearQuarter yq where yq.YearQuarterID = Vw_Class.YearQuarterID)", daysCount);
            int    count       = TestHelper.GetSectionCountWithFilter(new LateStartFacet());

            int allSectionCount = _dataVerifier.AllSectionsCount;

            Assert.IsTrue(allSectionCount > count, "Returned all Sections instead of a sub-set.");

            int expectedCount = _dataVerifier.GetSectionCount(whereClause);

            Assert.AreEqual(expectedCount, count);
        }
Exemple #8
0
        public void GetSections_Filtered_Modality_All_Success()
        {
            int count = TestHelper.GetSectionCountWithFilter(new ModalityFacet(ModalityFacet.Options.All));

            int allSectionCount = _dataVerifier.GetSectionCount("not ClassID is null");

            Assert.AreEqual(allSectionCount, count);
        }