Commit 0c8b3489 authored by 9731087's avatar 9731087

First commit

parent 60458b63
......@@ -24,13 +24,18 @@ class DepartmentTest {
student = new Student("Amir", "87", "am", department);
professor = new Professor(department, "mmd");
course = new Course("1", "az", department, professor, 100);
department.addStudent(student);
department.addProfessor(professor);
department.addCourse(course);
}
@Test
public void testDepartment(){
assertEquals(department.getCourses(), course);
assertEquals(department.getProfessors(),professor);
assertEquals(department.getStudents(), student);
}
......
package Test;
import com.university.*;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class UniversityTest {
static Department department;
static Student student;
static Course course;
static Professor professor;
static University university;
@BeforeAll
public static void creatProfessor() {
department = new Department("ce");
student = new Student("Amir", "87", "am", department);
professor = new Professor(department, "mmd");
course = new Course("1", "az", department, professor, 100);
department.addCourse(course);
department.addProfessor(professor);
department.addStudent(student);
university = new University();
university.addDepartment(department);
}
@Test
public void testProfessor() {
assertEquals(department, university.getDepartments());
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment