public void CourseDescription_CourseIDLookup_Success() { using (OdsRepository repository = new OdsRepository()) { IEnumerable <CourseDescription> courseDescriptions = repository.GetCourseDescription(CourseID.FromString("art 101")); Assert.IsNotNull(courseDescriptions, "Method returned null"); int allCoursesCount = courseDescriptions.Count(); Assert.IsTrue(allCoursesCount > 0, "{0} descriptions were returned", allCoursesCount); int filteredCourseCount = courseDescriptions.Where(c => Regex.IsMatch(c.CourseID.ToUpper(), @"ART\s+101")).Count(); Assert.AreEqual(allCoursesCount, filteredCourseCount); } }
public void RetrievingPresentAndFutureDescriptions() { using (OdsRepository ods = new OdsRepository()) { ICourseID courseID = CourseID.FromString("ECON&201"); IList <CourseDescription> descs = ods.GetCourseDescription(courseID, YearQuarter.FromString("B234")); Assert.IsNotNull(descs); foreach (CourseDescription desc in descs) { Console.Out.WriteLine("[{0}] {1}", desc.YearQuarterBegin, desc.Description); } Assert.IsTrue(descs.Count > 1, "ECON& 201 should have 2 descriptions, but only has {0}", descs.Count); } }
public void RetrievingPresentAndFutureDescriptions() { using (OdsRepository ods = new OdsRepository()) { ICourseID courseID = CourseID.FromString("ECON&201"); IList<CourseDescription> descs = ods.GetCourseDescription(courseID, YearQuarter.FromString("B234")); Assert.IsNotNull(descs); foreach (CourseDescription desc in descs) { Console.Out.WriteLine("[{0}] {1}", desc.YearQuarterBegin, desc.Description); } Assert.IsTrue(descs.Count > 1, "ECON& 201 should have 2 descriptions, but only has {0}", descs.Count); } }
public void CourseDescription_CourseIDLookup_Success() { using (OdsRepository repository = new OdsRepository()) { IEnumerable<CourseDescription> courseDescriptions = repository.GetCourseDescription(CourseID.FromString("art 101")); Assert.IsNotNull(courseDescriptions, "Method returned null"); int allCoursesCount = courseDescriptions.Count(); Assert.IsTrue(allCoursesCount > 0, "{0} descriptions were returned", allCoursesCount); int filteredCourseCount = courseDescriptions.Where(c => Regex.IsMatch(c.CourseID.ToUpper(), @"ART\s+101")).Count(); Assert.AreEqual(allCoursesCount, filteredCourseCount); } }