public void AddStudentToRegistry() { Admin admin = new Admin(); Register register = new Register(admin); register.AddStudentUser("Name", "Password", "Email"); Assert.AreEqual(register.Users.Count, 1); Assert.AreEqual(register.Users[0].MyPrivilege, User.Privilege.student); }
public void RemoveStudentFromRegistry() { Admin admin = new Admin(); Register register = new Register(admin); Student student = new Student("Name", "Password", "Email"); register.AddStudentUser(student); register.RemoveStudentUser(student); Assert.AreEqual(register.Users.Count, 0); }
public void SaveUserToXmlFileTest() { Admin admin = new Admin(); Register register = new Register(admin); Student student = new Student(); register.AddStudentUser(student); register.SaveUsers(); register = new Register(); register.Users = register.LoadUser(); Assert.AreEqual(register.Users.Count, 1); Assert.AreEqual(register.Users[0].MyPrivilege, User.Privilege.student); }
public void CourseSavesStudents() { Admin admin = new Admin(); Register register = new Register(admin); Student student = new Student("temp", "temp", "temp"); Teacher teacher = new Teacher("techer", "teacher", "teacher"); Course course = new Course(); register.AddStudentUser(student); register.AddTeacherUser(teacher); course.AddStudent(student); course.AddTeacher(teacher); register.AddCourse(course); register.SaveCourse(); register = new Register(); register.Courses = register.LoadCourses(); Assert.AreEqual(register.Courses[0].Students.Count, 1); }