public void TestEnrollmentRepository_Fetches_List_of_Terms()
        {
            IEnrollmentRepository      repository = new TestEnrollmentRepository();
            Dictionary <int, DateTime> terms      = repository.FetchTermsForOnlineEnrollment();

            Assert.IsNotNull(terms);
        }
        public void TestEnrollmentRepository_UnEnrollStudent_Throws_Exception_if_Student_is_Not_Enrolled()
        {
            // Case 1: course offering exists but student is not enrolled
            //
            IEnrollmentRepository repository = new TestEnrollmentRepository();
            int studentId        = 0;
            int courseOfferingNo = 1;

            try
            {
                // This line should throw an exception
                repository.UnEnrollStudent(studentId, courseOfferingNo);
                // This should not be executed. In case of a duplicate entry
                // above line must throw an exception.
                Assert.Fail();
            }
            catch (Exception)
            {
                // Nothing to do, since in this scenario exception must be thrown
            }


            // Case 2: course offering does not exists but student exists
            //
            studentId        = 1;
            courseOfferingNo = 0;

            try
            {
                // This line should throw an exception
                repository.UnEnrollStudent(studentId, courseOfferingNo);
                // This should not be executed. In case of a duplicate entry
                // above line must throw an exception.
                Assert.Fail();
            }
            catch (Exception)
            {
                // Nothing to do, since in this scenario exception must be thrown
            }



            // Case 3: both course offering and student do not exist
            //
            studentId        = 0;
            courseOfferingNo = 0;
            try
            {
                // This line should throw an exception
                repository.UnEnrollStudent(studentId, courseOfferingNo);
                // This should not be executed. In case of a duplicate entry
                // above line must throw an exception.
                Assert.Fail();
            }
            catch (Exception)
            {
                // Nothing to do, since in this scenario exception must be thrown
            }
        }
        public void TestEnrollmentRepository_UnEnroll_a_Enrolled_Student()
        {
            IEnrollmentRepository repository = new TestEnrollmentRepository();
            int  studentId        = 1;
            int  courseOfferingNo = 1;
            bool isEnrolled       = repository.UnEnrollStudent(studentId, courseOfferingNo);

            Assert.IsNotNull(isEnrolled);
        }
        public void TestEnrollmentRepository_Enrolls_Student_in_a_Class_Offered_in_a_Term()
        {
            IEnrollmentRepository repository = new TestEnrollmentRepository();

            var courseEnrollment = new CourseEnrollment
            {
                CourseOfferingNo = 0,
                StudentId        = 0,
                GradeNo          = 1,
                StatusId         = 1,
                ImportDate       = DateTime.Now,
                ImportConversion = "Student Portal"
            };
            int isEnrolled = repository.EnrollStudent(courseEnrollment);

            Assert.AreEqual(1, isEnrolled);
        }