Skip to content

Commit da4b11b

Browse files
committed
feat: 봉사 기록 엔티티 테스트 코드 추가
- 엔티티 생성 메서드 테스트및 검증 완료
1 parent 96e240e commit da4b11b

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.somemore.domains.volunteerrecord.domain;
2+
3+
import org.junit.jupiter.api.Test;
4+
5+
import java.time.LocalDate;
6+
import java.util.UUID;
7+
8+
import static org.assertj.core.api.Assertions.assertThat;
9+
10+
class VolunteerRecordTest {
11+
12+
@Test
13+
void createVolunteerRecord_success() {
14+
// Given
15+
UUID volunteerId = UUID.randomUUID();
16+
String title = "서울 도서관 봉사";
17+
LocalDate volunteerDate = LocalDate.of(2025, 1, 8);
18+
int volunteerHours = 4;
19+
20+
// When
21+
VolunteerRecord volunteerRecord = VolunteerRecord.create(volunteerId, title, volunteerDate, volunteerHours);
22+
23+
// Then
24+
assertThat(volunteerRecord).isNotNull();
25+
assertThat(volunteerRecord.getVolunteerId()).isEqualTo(volunteerId);
26+
assertThat(volunteerRecord.getTitle()).isEqualTo(title);
27+
assertThat(volunteerRecord.getVolunteerDate()).isEqualTo(volunteerDate);
28+
assertThat(volunteerRecord.getVolunteerHours()).isEqualTo(volunteerHours);
29+
}
30+
}

0 commit comments

Comments
 (0)