Skip to content
Snippets Groups Projects

M2 course tests

Merged Ester Vilímková requested to merge M2-course-tests into M2
1 file
+ 8
1
Compare changes
  • Side-by-side
  • Inline
@@ -5,6 +5,7 @@ import org.fuseri.model.dto.course.CourseDto;
import org.fuseri.model.dto.course.LanguageTypeDto;
import org.fuseri.model.dto.course.ProficiencyLevelDto;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@@ -27,6 +28,13 @@ final class CourseMapperTest {
@Autowired
private CourseMapper CourseMapper;
@BeforeEach
void setUp()
{
course.setId(1L);
courseDto.setId(1L);
}
@Test
void mapNullToDto() {
var createdDto = CourseMapper.mapToDto(null);
@@ -132,7 +140,6 @@ final class CourseMapperTest {
void mapToCourseCourseCreateDto() {
var createdCourse = CourseMapper.mapToCourse(courseCreateDto);
Assertions.assertEquals(course.getId(), createdCourse.getId());
Assertions.assertEquals(course.getName(), createdCourse.getName());
Assertions.assertEquals(course.getCapacity(), createdCourse.getCapacity());
Assertions.assertEquals(course.getStudents(), createdCourse.getStudents());
Loading