-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b1b6e3
commit ad0f5b4
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType; | ||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
import static org.mockito.Mockito.when; | ||
|
||
import com.study.realworld.global.exception.BusinessException; | ||
|
@@ -195,6 +196,30 @@ void unfollowingNotExceptionTest() { | |
.withMessageMatching("not follow user exception"); | ||
} | ||
|
||
@Test | ||
@DisplayName("follow 여부를 확인할 수 있다.") | ||
void isFollowTest() { | ||
|
||
// given | ||
User user = User.Builder() | ||
.profile(Username.of("username"), null, null) | ||
.password(Password.of("password")) | ||
.email(Email.of("[email protected]")) | ||
.build(); | ||
User followingUser = User.Builder() | ||
.profile(Username.of("followingUser"), null, null) | ||
.password(Password.of("password")) | ||
.email(Email.of("[email protected]")) | ||
.build(); | ||
user.followingUser(followingUser); | ||
|
||
// when | ||
boolean result = user.isFollow(followingUser); | ||
|
||
// then | ||
assertTrue(result); | ||
} | ||
|
||
@Test | ||
@DisplayName("equals hashCode 테스트") | ||
void userEqualsHashCodeTest() { | ||
|