feat(creator): 선물 신청 진입점을 추가한다
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
package kr.co.vividnext.sodalive.v2.creator.channel
|
||||
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class CreatorChannelGiftEligibilityTest {
|
||||
|
||||
@Test
|
||||
fun `비소유자이고 DM 가능이면 선물 보내기 버튼을 표시한다`() {
|
||||
assertTrue(canSendCreatorGift(isOwner = false, isDmAvailable = true))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `비소유자라도 DM 불가이면 선물 보내기 버튼을 숨긴다`() {
|
||||
assertFalse(canSendCreatorGift(isOwner = false, isDmAvailable = false))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `소유자는 DM 가능 상태여도 선물 보내기 버튼을 숨긴다`() {
|
||||
assertFalse(canSendCreatorGift(isOwner = true, isDmAvailable = true))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `소유자이고 DM 불가이면 선물 보내기 버튼을 숨긴다`() {
|
||||
assertFalse(canSendCreatorGift(isOwner = true, isDmAvailable = false))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package kr.co.vividnext.sodalive.v2.gift
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Assert.assertNotNull
|
||||
import org.junit.Test
|
||||
|
||||
class GiftSendEntryPolicyTest {
|
||||
|
||||
@Test
|
||||
fun `회원번호가 0 이하이면 진입 정보가 거부된다`() {
|
||||
assertNull(GiftSendRequestPresenter.toValidEntry(0L, "크리에이터"))
|
||||
assertNull(GiftSendRequestPresenter.toValidEntry(-1L, "크리에이터"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `닉네임이 비어 있거나 공백이면 진입 정보가 거부된다`() {
|
||||
assertNull(GiftSendRequestPresenter.toValidEntry(1L, ""))
|
||||
assertNull(GiftSendRequestPresenter.toValidEntry(1L, " "))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `유효한 회원번호와 닉네임이면 진입 정보를 반환한다`() {
|
||||
val entry = GiftSendRequestPresenter.toValidEntry(1L, "크리에이터")
|
||||
|
||||
assertNotNull(entry)
|
||||
assertEquals(GiftSendEntry(1L, "크리에이터"), entry)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user