public void RegisterStudentForReAdmissionTest() { int termId = 13; int studentNum = GetLastStudentNum(); Assert.AreNotEqual(0, studentNum); CentennialDA dao = new CentennialDA(); Student student = dao.FindStudentByStudentNum($"test{studentNum}"); Assert.IsNotNull(student); int studentId = student.StudentId; student.StudentCanRegister = false; dao.UpdateStudent(student); bool registrationEnabled = dao.StudentCanRegister(studentId); Assert.IsFalse(registrationEnabled); bool hasRegistration = dao.HasValidRegistration(studentId, termId); Assert.IsFalse(hasRegistration); dao.EnableStudentCanRegister(studentId); registrationEnabled = dao.StudentCanRegister(studentId); Assert.IsTrue(registrationEnabled); dao.ProgramRegistrationReAdmit(termId, studentId); hasRegistration = dao.HasValidRegistration(studentId, termId); Assert.IsTrue(hasRegistration); }
public void NewStudentRegistrationTest() { DateTime registrationDate = new DateTime(2013, 8, 20); int termId = 3, programId = 1, currentSemester = 1; int studentNum = GetNextStudentNum(); Student student = new Student { StudentNum = $"test{studentNum}", StudentLastName = "LName", StudentFirstMidName = "FName", StudentEmail = "test", StudentHasHolds = false, StudentAcademicStanding = true, StudentCanRegister = true, StudentStartDate = registrationDate }; CentennialDA dao = new CentennialDA(); dao.CreateStudent(ref student); int studentId = student.StudentId; Assert.AreNotEqual(0, studentId); Console.WriteLine($"StudentId for freshly created student: {studentId}"); dao.ProgramRegistrationNew(termId, programId, currentSemester, studentId); bool programRegistrationDone = dao.HasValidRegistration(studentId, termId); Assert.IsTrue(programRegistrationDone); dao.CreateTranscript(studentId); Transcript transcript = dao.GetStudentTranscript(studentId); Assert.AreEqual($"test{studentNum}", transcript.studentNumber); }
public StudentController() { dao = new CentennialDA(); }
public void TransferStudentProgramTest() { // setup student and program DateTime registrationDate = new DateTime(2013, 8, 20); int termId = 3, programId = 1, currentSemester = 1; int studentNum = GetNextStudentNum(); Student student = new Student { StudentNum = $"test{studentNum}", StudentLastName = "LName", StudentFirstMidName = "FName", StudentEmail = "test", StudentHasHolds = false, StudentAcademicStanding = true, StudentCanRegister = true, StudentStartDate = registrationDate }; CentennialDA dao = new CentennialDA(); dao.CreateStudent(ref student); int studentId = student.StudentId; dao.ProgramRegistrationNew(termId, programId, currentSemester, studentId); dao.CreateTranscript(studentId); Assert.AreEqual(programId, dao.GetCurrentProgramId(studentId)); currentSemester = dao.GetCurrentSemesterInStudentProgram(studentId, programId); Assert.AreEqual(1, currentSemester); // add credits to student's record dao.AddTransferCredit(studentId, dao.ConvertToTransferCredit(1, "York", "A")); dao.AddTransferCredit(studentId, dao.ConvertToTransferCredit(2, "York", "A")); dao.AddTransferCredit(studentId, dao.ConvertToTransferCredit(3, "York", "A")); dao.AddTransferCredit(studentId, dao.ConvertToTransferCredit(5, "York", "A")); dao.AddTransferCredit(studentId, dao.ConvertToTransferCredit(6, "York", "A")); dao.AddTransferCredit(studentId, dao.ConvertToTransferCredit(7, "York", "A")); dao.AddTransferCredit(studentId, dao.ConvertToTransferCredit(8, "York", "A")); dao.AddTransferCredit(studentId, dao.ConvertToTransferCredit(17, "York", "A")); dao.AddTransferCredit(studentId, dao.ConvertToTransferCredit(18, "York", "A")); dao.AddTransferCredit(studentId, dao.ConvertToTransferCredit(19, "York", "A")); dao.AddTransferCredit(studentId, dao.ConvertToTransferCredit(21, "York", "A")); dao.AddTransferCredit(studentId, dao.ConvertToTransferCredit(23, "York", "A")); dao.AddTransferCredit(studentId, dao.ConvertToTransferCredit(24, "York", "A")); // transfer to new program programId = 2; termId = 13; currentSemester = dao.GetCurrentSemesterInStudentProgram(studentId, programId); Assert.AreEqual(3, currentSemester); Transcript transcript = dao.GetStudentTranscript(studentId); string oldProgram = transcript.history[0].program; dao.TransferStudentToProgram(termId, studentId, programId, currentSemester); transcript = dao.GetStudentTranscript(studentId); string newProgram = transcript.history[0].program; Assert.AreNotEqual(oldProgram, newProgram); Assert.AreEqual(programId, dao.GetCurrentProgramId(studentId)); }
public RegistrationController() { dao = new CentennialDA(); }
public StaffController() { dao = new CentennialDA(); }
public void CancelRegistrationTest() { // setup student DateTime registrationDate = new DateTime(2013, 8, 20); int termId = 3, programId = 1, currentSemester = 1; int studentNum = GetNextStudentNum(); Student student = new Student { StudentNum = $"test{studentNum}", StudentLastName = "LName", StudentFirstMidName = "FName", StudentEmail = "test", StudentHasHolds = false, StudentAcademicStanding = true, StudentCanRegister = true, StudentStartDate = registrationDate }; CentennialDA dao = new CentennialDA(); dao.CreateStudent(ref student); int studentId = student.StudentId; dao.ProgramRegistrationNew(termId, programId, currentSemester, studentId); dao.CreateTranscript(studentId); // enroll in courses int coursesToEnroll = 3; foreach (TermCourseOption o in dao.GetTermCourses(termId)) { if (coursesToEnroll == 0) { break; } int sectionId = dao.GetSectionsForTermCourse(o.TermCourseId)[0].SectionId; dao.AddEnrollment(studentId, sectionId); coursesToEnroll--; } int numberEnrolledCourses = dao.GetNumberEnrolledCourses(studentId, termId); Assert.AreEqual(3, numberEnrolledCourses); numberEnrolledCourses = dao.GetStudentTranscript(studentId).history[0].records[0].institution.terms[0].courses.Count; Assert.AreEqual(3, numberEnrolledCourses); numberEnrolledCourses = dao.GetInvoiceInfo(studentId, termId).Invoice.tuition.Count; Assert.AreEqual(3, numberEnrolledCourses); bool hasRegistration = dao.HasValidRegistration(studentId, termId); Assert.IsTrue(hasRegistration); // cancel registration dao.CancelRegistration(studentId, termId); numberEnrolledCourses = dao.GetNumberEnrolledCourses(studentId, termId); Assert.AreEqual(0, numberEnrolledCourses); numberEnrolledCourses = dao.GetStudentTranscript(studentId).history[0].records[0].institution.terms[0].courses.Count; Assert.AreEqual(0, numberEnrolledCourses); Assert.IsNull(dao.GetInvoiceInfo(studentId, termId)); hasRegistration = dao.HasValidRegistration(studentId, termId); Assert.IsFalse(hasRegistration); }
public AccountController() { dao = new CentennialDA(); }