feat(home): 홈 추천 activity type 매퍼를 추가한다

This commit is contained in:
2026-06-02 12:09:46 +09:00
parent c74ceba495
commit 4817641155
3 changed files with 86 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
package kr.co.vividnext.sodalive.v2.main.home
import kr.co.vividnext.sodalive.R
import kr.co.vividnext.sodalive.v2.main.home.model.toRecommendedActivityTypeLabelRes
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Test
class RecommendedActivityTypeTest {
@Test
fun `LIVE maps to live label`() {
assertEquals(
R.string.home_recommendation_activity_live,
"LIVE".toRecommendedActivityTypeLabelRes()
)
}
@Test
fun `LIVE_REPLAY maps to live label`() {
assertEquals(
R.string.home_recommendation_activity_live,
"LIVE_REPLAY".toRecommendedActivityTypeLabelRes()
)
}
@Test
fun `AUDIO maps to audio label`() {
assertEquals(
R.string.home_recommendation_activity_audio,
"AUDIO".toRecommendedActivityTypeLabelRes()
)
}
@Test
fun `COMMUNITY maps to community label`() {
assertEquals(
R.string.home_recommendation_activity_community,
"COMMUNITY".toRecommendedActivityTypeLabelRes()
)
}
@Test
fun `lowercase activity type maps to matching label`() {
assertEquals(
R.string.home_recommendation_activity_live,
"live".toRecommendedActivityTypeLabelRes()
)
}
@Test
fun `mixed case activity type maps to matching label`() {
assertEquals(
R.string.home_recommendation_activity_live,
"Live_RePlay".toRecommendedActivityTypeLabelRes()
)
}
@Test
fun `unknown activity type maps to null`() {
assertNull("UNKNOWN".toRecommendedActivityTypeLabelRes())
}
}