Skip to content
Snippets Groups Projects
Commit 9b82438b authored by Ester Vilímková's avatar Ester Vilímková
Browse files

Making CourseMapperTest use Equals

parent 3b2c6ac3
No related branches found
No related tags found
2 merge requests!31M2,!23M2 course tests
This commit is part of merge request !23. Comments created here will be created in the context of that merge request.
......@@ -46,12 +46,7 @@ final class CourseMapperTest {
void mapToDto() {
var createdDto = CourseMapper.mapToDto(course);
Assertions.assertEquals(courseDto.getId(), createdDto.getId());
Assertions.assertEquals(courseDto.getName(), createdDto.getName());
Assertions.assertEquals(courseDto.getCapacity(), createdDto.getCapacity());
Assertions.assertEquals(courseDto.getLanguage(), createdDto.getLanguage());
Assertions.assertEquals(courseDto.getProficiency(), createdDto.getProficiency());
Assertions.assertEquals(courseDto.getStudentIds(), createdDto.getStudentIds());
Assertions.assertEquals(courseDto, createdDto);
}
@Test
......@@ -65,12 +60,7 @@ final class CourseMapperTest {
void mapToCourseCourseDto() {
var createdCourse = CourseMapper.mapToCourse(courseDto);
Assertions.assertEquals(course.getId(), createdCourse.getId());
Assertions.assertEquals(course.getName(), createdCourse.getName());
Assertions.assertEquals(course.getCapacity(), createdCourse.getCapacity());
Assertions.assertEquals(course.getStudents(), createdCourse.getStudents());
Assertions.assertEquals(course.getProficiency(), createdCourse.getProficiency());
Assertions.assertEquals(course.getLanguage(), createdCourse.getLanguage());
Assertions.assertEquals(course, createdCourse);
}
@Test
......@@ -91,15 +81,10 @@ final class CourseMapperTest {
void mapToList() {
var courseDtos = CourseMapper.mapToList(Collections.singletonList(course));
Assertions.assertEquals(courseDtos.size(), 1);
Assertions.assertEquals(1, courseDtos.size());
Assertions.assertEquals(courseDto.getId(), courseDtos.get(0).getId());
Assertions.assertEquals(courseDto.getName(), courseDtos.get(0).getName());
Assertions.assertEquals(courseDto.getCapacity(), courseDtos.get(0).getCapacity());
Assertions.assertEquals(courseDto.getLanguage(), courseDtos.get(0).getLanguage());
Assertions.assertEquals(courseDto.getProficiency(), courseDtos.get(0).getProficiency());
Assertions.assertEquals(courseDto.getStudentIds(), courseDtos.get(0).getStudentIds());
Assertions.assertEquals(courseDto, courseDtos.get(0));
}
@Test
......@@ -121,12 +106,7 @@ final class CourseMapperTest {
Assertions.assertEquals(page.getSize(), pageDto.getSize());
Assertions.assertEquals(page.getTotalElements(), pageDto.getTotalElements());
Assertions.assertEquals(courseDto.getId(), pageDto.getContent().get(0).getId());
Assertions.assertEquals(courseDto.getName(), pageDto.getContent().get(0).getName());
Assertions.assertEquals(courseDto.getCapacity(), pageDto.getContent().get(0).getCapacity());
Assertions.assertEquals(courseDto.getLanguage(), pageDto.getContent().get(0).getLanguage());
Assertions.assertEquals(courseDto.getProficiency(), pageDto.getContent().get(0).getProficiency());
Assertions.assertEquals(courseDto.getStudentIds(), pageDto.getContent().get(0).getStudentIds());
Assertions.assertEquals(courseDto, pageDto.getContent().get(0));
}
@Test
......@@ -140,11 +120,7 @@ final class CourseMapperTest {
void mapToCourseCourseCreateDto() {
var createdCourse = CourseMapper.mapToCourse(courseCreateDto);
Assertions.assertEquals(course.getName(), createdCourse.getName());
Assertions.assertEquals(course.getCapacity(), createdCourse.getCapacity());
Assertions.assertEquals(course.getStudents(), createdCourse.getStudents());
Assertions.assertEquals(course.getProficiency(), createdCourse.getProficiency());
Assertions.assertEquals(course.getLanguage(), createdCourse.getLanguage());
Assertions.assertEquals(course, createdCourse);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment