コード例 #1
0
        public void TestGetCoursesForDept()
        {
            List <Course> result1 = CourseLogic.GetCoursesForDept(testCourseList, "Test Department 1");

            Assert.IsNotNull(result1);
            Assert.IsTrue(result1.Contains(testCourse1));

            List <Course> result2 = CourseLogic.GetCoursesForDept(testCourseList, "Test Department 2");

            Assert.IsNotNull(result2);
            Assert.IsTrue(result2.Contains(testCourse2));
        }
コード例 #2
0
        public async Task <List <Course> > GetCoursesForDept(string key)
        {
            List <Course> list = new List <Course>();

            var courses = await _context.ScanAsync <Course>(new List <ScanCondition>()).GetRemainingAsync();

            if (courses != null)
            {
                list = CourseLogic.GetCoursesForDept(courses, key);
            }
            else
            {
                throw new SimpliPassException("Failed to get Courses Table.");
            }

            return(list);
        }
コード例 #3
0
        public void TestGetCoursesForDeptNull()
        {
            List <Course> result = CourseLogic.GetCoursesForDept(null, "Test Department 1");

            Assert.IsNull(result);
        }