From fe195527410673f13a8fe4dff9cbd1331345310d Mon Sep 17 00:00:00 2001 From: klaus Date: Mon, 22 Jun 2026 23:22:40 +0900 Subject: [PATCH] =?UTF-8?q?test(creator):=20=ED=9B=84=EC=9B=90=20=EC=84=B1?= =?UTF-8?q?=EA=B3=B5=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EA=B8=B0=EB=8C=80?= =?UTF-8?q?=EA=B0=92=EC=9D=84=20=EB=B3=B4=EC=A0=95=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../channel/donation/CreatorChannelDonationViewModelTest.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/donation/CreatorChannelDonationViewModelTest.kt b/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/donation/CreatorChannelDonationViewModelTest.kt index e012e2e3..b4e4a08d 100644 --- a/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/donation/CreatorChannelDonationViewModelTest.kt +++ b/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/donation/CreatorChannelDonationViewModelTest.kt @@ -118,7 +118,7 @@ class CreatorChannelDonationViewModelTest { } @Test - fun `채널 후원 성공 시 보유 can보다 큰 금액 차감은 0으로 보정한다`() { + fun `채널 후원 성공 시 보유 can보다 큰 금액도 성공 이벤트와 첫 페이지 재조회를 수행한다`() { whenever(repository.getDonations(100L, 0, CreatorChannelDonationViewModel.DEFAULT_PAGE_SIZE, "Bearer test-token")) .thenReturn(Single.just(ApiResponse(true, donationResponse(ids = listOf(1L)), null))) .thenReturn(Single.just(ApiResponse(true, donationResponse(ids = listOf(2L)), null))) @@ -130,7 +130,9 @@ class CreatorChannelDonationViewModelTest { SharedPreferenceManager.can = 30 viewModel.postChannelDonation(can = 250, isSecret = false, message = "응원") - assertEquals(0, SharedPreferenceManager.can) + verify(repository).postChannelDonation(100L, 250, false, "응원", "Bearer test-token") + verify(repository, times(2)).getDonations(100L, 0, CreatorChannelDonationViewModel.DEFAULT_PAGE_SIZE, "Bearer test-token") + assertEquals(true, viewModel.consumeDonationSuccessEvent()) } @Test