Пример #1
0
        public void EnrollSchedule(string studentId, int scheduleId, string grade_option, int pre_req_status)
        {
            var errors     = new List <string>();
            var repository = new StudentEnrollmentRepository();
            var service    = new StudentEnrollmentService(new EnrollmentRuleRepository(), repository);

            service.EnrollSchedule(studentId, scheduleId, grade_option, pre_req_status, ref errors);
        }
Пример #2
0
        //// [ExpectedException(typeof(ArgumentException))]
        public void EnrollmentScheduleInvalidStudentIdTest()
        {
            //// Arrange
            var errors                   = new List <string>();
            var mockRepository           = new Mock <IStudentEnrollmentRepository>();
            var mockRepository2          = new Mock <IEnrollmentRuleRepository>();
            var studentEnrollmentService = new StudentEnrollmentService(mockRepository2.Object, mockRepository.Object);
            var list = new List <StudentEnrollment>();

            //// Act
            studentEnrollmentService.EnrollSchedule("A111---11", 1, "Letter", 1, ref errors);
            studentEnrollmentService.EnrollSchedule("?00000011", 1, "Letter", 1, ref errors);
            studentEnrollmentService.EnrollSchedule("111111111", 1, "Letter", 1, ref errors);
            studentEnrollmentService.EnrollSchedule("AA1111111", 1, "Letter", 1, ref errors);

            //// Assert
            Assert.AreEqual(4, errors.Count);
        }
Пример #3
0
        ////[ExpectedException(typeof(ArgumentException))]
        public void EnrollmentScheduleNullEnrollmentTest()
        {
            //// Arrange
            var errors                   = new List <string>();
            var mockRepository           = new Mock <IStudentEnrollmentRepository>();
            var mockRepository2          = new Mock <IEnrollmentRuleRepository>();
            var studentEnrollmentService = new StudentEnrollmentService(mockRepository2.Object, mockRepository.Object);
            var list = new List <StudentEnrollment>();

            //// Act
            studentEnrollmentService.EnrollSchedule(null, 1, "Letter", 1, ref errors);

            //// Assert
            Assert.AreEqual(1, errors.Count);
        }
Пример #4
0
        //// [ExpectedException(typeof(ArgumentException))]
        public void EnrollmentScheduleShortStudentIdTestSuccess()
        {
            //// Arrange
            var errors                   = new List <string>();
            var mockRepository           = new Mock <IStudentEnrollmentRepository>();
            var mockRepository2          = new Mock <IEnrollmentRuleRepository>();
            var studentEnrollmentService = new StudentEnrollmentService(mockRepository2.Object, mockRepository.Object);
            var list = new List <StudentEnrollment>();

            //// Act
            studentEnrollmentService.EnrollSchedule("A51147417", 1, "Letter", 1, ref errors);

            //// Assert
            Assert.AreEqual(0, errors.Count);
        }
Пример #5
0
        //// [ExpectedException(typeof(ArgumentException))]
        public void EnrollmentScheduleSuccessTest()
        {
            //// Arrange
            var errors                   = new List <string>();
            var mockRepository           = new Mock <IStudentEnrollmentRepository>();
            var mockRepository2          = new Mock <IEnrollmentRuleRepository>();
            var studentEnrollmentService = new StudentEnrollmentService(mockRepository2.Object, mockRepository.Object);
            var list = new List <StudentEnrollment>();

            //// Act
            list.Add(new StudentEnrollment {
                StudentId = "A000000", ScheduleId = 1, GradeOption = "Letter", PrereqStatus = 1
            });
            studentEnrollmentService.EnrollSchedule("A000000", 1, "Letter", 1, ref errors);

            //// Assert
            Assert.AreEqual(0, errors.Count);
        }