Zmiana nazwy z Remove na Delete, dodanie testu na usuwanie.
Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
parent
283be6603d
commit
551011db1c
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user