Zmiana nazwy z Remove na Delete, dodanie testu na usuwanie.

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
Marcin Woźniak 2020-09-16 17:21:01 +02:00
parent 283be6603d
commit 551011db1c
2 changed files with 7 additions and 2 deletions

View File

@ -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);
}

View File

@ -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);
}
}