diff --git a/buisnesslogic/src/main/java/com/plannaplan/services/CourseService.java b/buisnesslogic/src/main/java/com/plannaplan/services/CourseService.java index 755e801..15ae1aa 100644 --- a/buisnesslogic/src/main/java/com/plannaplan/services/CourseService.java +++ b/buisnesslogic/src/main/java/com/plannaplan/services/CourseService.java @@ -25,7 +25,7 @@ public class CourseService { this.repo.save(course); } - public void remove(Course course){ + public void delete(Course course){ this.repo.delete(course); } diff --git a/buisnesslogic/src/test/java/com/plannaplan/services/CourseServiceTest.java b/buisnesslogic/src/test/java/com/plannaplan/services/CourseServiceTest.java index 05e1a38..10a609f 100644 --- a/buisnesslogic/src/test/java/com/plannaplan/services/CourseServiceTest.java +++ b/buisnesslogic/src/test/java/com/plannaplan/services/CourseServiceTest.java @@ -19,14 +19,19 @@ public class CourseServiceTest { private CourseService courseService; @Test - public void shoulReturnYes() { + public void createAndDeleteCourse() { Course course; int startAmmount = this.courseService.getCoursesAmmount(); + // Create course course = new Course(); course.setName("Testowy kurs"); course.setSymbol("TK"); courseService.save(course); assertTrue(this.courseService.getCoursesAmmount() > startAmmount); + + // Delete course + courseService.delete(course); + assertTrue(this.courseService.getCoursesAmmount() == startAmmount); } }