package test.model;

import model.Teacher;
import org.junit.Test;
import static org.junit.Assert.*;

public class TeacherTest {

    @Test
    public void testConstructorAndGetters() {
        String teacherId = "T001";
        String name = "张老师";
        String department = "计算机系";
        String contact = "13800138000";
        String password = "password123";

        Teacher teacher = new Teacher(teacherId, name, department, contact, password);

        assertEquals("教师工号应匹配", teacherId, teacher.getTeacherId());
        assertEquals("教师姓名应匹配", name, teacher.getName());
        assertEquals("所属部门应匹配", department, teacher.getDepartment());
        assertEquals("联系方式应匹配", contact, teacher.getContact());
        assertEquals("密码应匹配", password, teacher.getPassword());
    }

    @Test
    public void testSetters() {
        Teacher teacher = new Teacher();

        String teacherId = "T002";
        String name = "李老师";
        String department = "数学系";
        String contact = "13900139000";
        String password = "newpass123";


        teacher.setTeacherId(teacherId);
        teacher.setName(name);
        teacher.setDepartment(department);
        teacher.setContact(contact);
        teacher.setPassword(password);


        assertEquals("教师工号应匹配", teacherId, teacher.getTeacherId());
        assertEquals("教师姓名应匹配", name, teacher.getName());
        assertEquals("所属部门应匹配", department, teacher.getDepartment());
        assertEquals("联系方式应匹配", contact, teacher.getContact());
        assertEquals("密码应匹配", password, teacher.getPassword());
    }
}