diff --git a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelPagerAdapter.kt b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelPagerAdapter.kt index bdddf8dd..b9ae3d37 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelPagerAdapter.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelPagerAdapter.kt @@ -3,6 +3,7 @@ package kr.co.vividnext.sodalive.v2.creator.channel import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity import androidx.viewpager2.adapter.FragmentStateAdapter +import kr.co.vividnext.sodalive.v2.creator.channel.audio.CreatorChannelAudioFragment import kr.co.vividnext.sodalive.v2.creator.channel.live.CreatorChannelLiveFragment import kr.co.vividnext.sodalive.v2.creator.channel.model.CreatorChannelTab @@ -19,6 +20,7 @@ class CreatorChannelPagerAdapter( return when (tab) { CreatorChannelTab.Home -> CreatorChannelHomeFragment.newInstance(creatorId) CreatorChannelTab.Live -> CreatorChannelLiveFragment.newInstance(creatorId) + CreatorChannelTab.Audio -> CreatorChannelAudioFragment.newInstance(creatorId) else -> CreatorChannelPlaceholderFragment.newInstance(tab) } } diff --git a/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelPagerAdapterTest.kt b/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelPagerAdapterTest.kt index 1fcc9824..9035ffff 100644 --- a/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelPagerAdapterTest.kt +++ b/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelPagerAdapterTest.kt @@ -2,6 +2,7 @@ package kr.co.vividnext.sodalive.v2.creator.channel import android.app.Application import androidx.fragment.app.FragmentActivity +import kr.co.vividnext.sodalive.v2.creator.channel.audio.CreatorChannelAudioFragment import kr.co.vividnext.sodalive.v2.creator.channel.live.CreatorChannelLiveFragment import kr.co.vividnext.sodalive.v2.creator.channel.model.CreatorChannelTab import org.junit.Assert.assertEquals @@ -17,14 +18,15 @@ import org.robolectric.annotation.Config class CreatorChannelPagerAdapterTest { @Test - fun `createFragment는 Home과 Live를 실제 Fragment로 생성하고 나머지는 placeholder를 유지한다`() { + fun `createFragment는 Home Live Audio를 실제 Fragment로 생성하고 나머지는 placeholder를 유지한다`() { val activity = Robolectric.buildActivity(FragmentActivity::class.java).setup().get() val adapter = CreatorChannelPagerAdapter(activity, creatorId = 123L) assertTrue(adapter.createFragment(CreatorChannelTab.Home.ordinal) is CreatorChannelHomeFragment) assertTrue(adapter.createFragment(CreatorChannelTab.Live.ordinal) is CreatorChannelLiveFragment) + assertTrue(adapter.createFragment(CreatorChannelTab.Audio.ordinal) is CreatorChannelAudioFragment) CreatorChannelTab.entries - .filterNot { it == CreatorChannelTab.Home || it == CreatorChannelTab.Live } + .filterNot { it == CreatorChannelTab.Home || it == CreatorChannelTab.Live || it == CreatorChannelTab.Audio } .forEach { tab -> assertTrue(adapter.createFragment(tab.ordinal) is CreatorChannelPlaceholderFragment) }