예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
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);
        }
예제 #4
0
        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);
        }