Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Paysafe Interns Valentin-Martin
Student Managment
david-krastev-student-management-2023
Commits
ff3452c0
Commit
ff3452c0
authored
1 year ago
by
David Krastev
Browse files
Options
Download
Email Patches
Plain Diff
testing + refactoring
parent
9e2d4940
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
student-managment-app/data-model/services/build.gradle.kts
+0
-9
student-managment-app/data-model/services/build.gradle.kts
student-managment-app/data-model/services/src/test/java/student/managment/app/list/LinkedListTest.java
+0
-50
.../test/java/student/managment/app/list/LinkedListTest.java
student-managment-app/data-model/src/main/java/student/managment/app/entities/Grade.java
+31
-0
...l/src/main/java/student/managment/app/entities/Grade.java
student-managment-app/data-model/src/main/java/student/managment/app/entities/Student.java
+0
-4
...src/main/java/student/managment/app/entities/Student.java
student-managment-app/repositories/src/main/java/student/managment/app/repositories/StudentRepositoryImpl.java
+0
-4
...ent/managment/app/repositories/StudentRepositoryImpl.java
student-managment-app/services/src/main/java/student/managment/app/services/CourseService.java
+1
-1
...in/java/student/managment/app/services/CourseService.java
student-managment-app/services/src/main/java/student/managment/app/services/StudentService.java
+0
-1
...n/java/student/managment/app/services/StudentService.java
student-managment-app/services/src/test/java/student/managment/app/services/CourseServiceTest.java
+12
-0
...ava/student/managment/app/services/CourseServiceTest.java
with
44 additions
and
69 deletions
+44
-69
student-managment-app/data-model/services/build.gradle.kts
deleted
100644 → 0
+
0
-
9
View file @
9e2d4940
/*
* This file was generated by the Gradle 'init' task.
*
* This project uses @Incubating APIs which are subject to change.
*/
plugins
{
id
(
"student.managment.app.java-library-conventions"
)
}
This diff is collapsed.
Click to expand it.
student-managment-app/data-model/services/src/test/java/student/managment/app/list/LinkedListTest.java
deleted
100644 → 0
+
0
-
50
View file @
9e2d4940
/*
* This Java source file was generated by the Gradle 'init' task.
*/
package
student.managment.app.services
;
import
org.junit.jupiter.api.Test
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.*;
class
LinkedListTest
{
@Test
void
testConstructor
()
{
LinkedList
list
=
new
LinkedList
();
assertEquals
(
0
,
list
.
size
());
}
@Test
void
testAdd
()
{
LinkedList
list
=
new
LinkedList
();
list
.
add
(
"one"
);
assertEquals
(
1
,
list
.
size
());
assertEquals
(
"one"
,
list
.
get
(
0
));
list
.
add
(
"two"
);
assertEquals
(
2
,
list
.
size
());
assertEquals
(
"two"
,
list
.
get
(
1
));
}
@Test
void
testRemove
()
{
LinkedList
list
=
new
LinkedList
();
list
.
add
(
"one"
);
list
.
add
(
"two"
);
assertTrue
(
list
.
remove
(
"one"
));
assertEquals
(
1
,
list
.
size
());
assertEquals
(
"two"
,
list
.
get
(
0
));
assertTrue
(
list
.
remove
(
"two"
));
assertEquals
(
0
,
list
.
size
());
}
@Test
public
void
testRemoveMissing
()
{
LinkedList
list
=
new
LinkedList
();
list
.
add
(
"one"
);
list
.
add
(
"two"
);
assertFalse
(
list
.
remove
(
"three"
));
assertEquals
(
2
,
list
.
size
());
}
}
This diff is collapsed.
Click to expand it.
student-managment-app/data-model/src/main/java/student/managment/app/entities/Grade.java
0 → 100644
+
31
-
0
View file @
ff3452c0
package
student.managment.app.entities
;
public
class
Grade
{
private
String
courseName
;
private
double
grade
;
public
Grade
()
{
}
public
Grade
(
String
courseName
,
double
grade
)
{
this
.
courseName
=
courseName
;
this
.
grade
=
grade
;
}
public
String
getCourseName
()
{
return
courseName
;
}
public
void
setCourseName
(
String
courseName
)
{
this
.
courseName
=
courseName
;
}
public
double
getGrade
()
{
return
grade
;
}
public
void
setGrade
(
double
grade
)
{
this
.
grade
=
grade
;
}
}
This diff is collapsed.
Click to expand it.
student-managment-app/data-model/src/main/java/student/managment/app/entities/Student.java
+
0
-
4
View file @
ff3452c0
package
student.managment.app.entities
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.*
;
public
class
Student
{
...
...
@@ -47,6 +45,4 @@ public class Student {
public
void
addCourse
(
Course
course
)
{
this
.
courses
.
add
(
course
);
}
}
This diff is collapsed.
Click to expand it.
student-managment-app/repositories/src/main/java/student/managment/app/repositories/StudentRepositoryImpl.java
+
0
-
4
View file @
ff3452c0
...
...
@@ -20,10 +20,6 @@ public class StudentRepositoryImpl implements StudentRepository {
@Override
public
void
add
(
Student
student
)
{
// if (students.containsKey(student.getId())) {
// System.out.println("Student with given ID already exists");
// return;
// }
this
.
students
.
put
(
student
.
getId
(),
student
);
}
...
...
This diff is collapsed.
Click to expand it.
student-managment-app/services/src/main/java/student/managment/app/services/CourseService.java
+
1
-
1
View file @
ff3452c0
...
...
@@ -150,4 +150,4 @@ public class CourseService {
gradeWithStudents
.
forEach
((
grade
,
students
)
->
students
.
forEach
(
s
->
System
.
out
.
printf
(
"-> %s %.2f \n"
,
s
.
getName
(),
grade
)));
});
}
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
student-managment-app/services/src/main/java/student/managment/app/services/StudentService.java
+
0
-
1
View file @
ff3452c0
...
...
@@ -51,4 +51,3 @@ public class StudentService {
}
}
This diff is collapsed.
Click to expand it.
student-managment-app/services/src/test/java/student/managment/app/services/CourseServiceTest.java
+
12
-
0
View file @
ff3452c0
package
student.managment.app.services
;
import
org.junit.jupiter.api.Assertions
;
import
org.junit.jupiter.api.BeforeAll
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
student.managment.app.entities.Course
;
import
student.managment.app.entities.Teacher
;
...
...
@@ -17,6 +19,16 @@ public class CourseServiceTest {
this
.
teacherService
=
new
TeacherService
();
}
@BeforeAll
public
static
void
beforeAll
()
{
}
@BeforeEach
public
void
beforeEach
()
{
}
@Test
public
void
whenAddingNewCourseShouldIncreaseSize
()
{
this
.
courseService
.
addCourse
(
new
Course
(
1L
,
"mathematics"
,
12
));
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help