Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
Lab 6
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
9731087
Lab 6
Commits
0c8b3489
Commit
0c8b3489
authored
Apr 14, 2019
by
9731087
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First commit
parent
60458b63
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
1 deletion
+38
-1
DepartmentTest.java
src/Test/DepartmentTest.java
+6
-1
UniversityTest.java
src/Test/UniversityTest.java
+32
-0
No files found.
src/Test/DepartmentTest.java
View file @
0c8b3489
...
...
@@ -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
);
}
...
...
src/Test/UniversityTest.java
View file @
0c8b3489
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment