Skip to content

Commit

Permalink
fix: 변경 사항 테스트에 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
belljun3395 committed Sep 30, 2024
1 parent 60f3388 commit d24e5d3
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.few.api.domain.workbook.usecase.model.order

import com.few.api.domain.workbook.usecase.model.MemberSubscribedWorkbook
import com.few.api.domain.workbook.usecase.model.WorkBook
import com.few.api.domain.workbook.usecase.model.WorkBooks
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test
import java.net.URL
Expand Down Expand Up @@ -59,12 +60,12 @@ class AuthMainViewWorkbookOrderDelegatorTest {
)

// then
val orderedWorkbooks = delegator.order(workbooksOrderBySubscriptionCount)
assertEquals(totalWorkbookCount, orderedWorkbooks.workbooks.size)
val orderedWorkbooks = delegator.order(OrderTargetWorkBooks(WorkBooks(workbooksOrderBySubscriptionCount)))
assertEquals(totalWorkbookCount, orderedWorkbooks.workbooks.workbookData.size)

val expectedOrderedWorkbookIds = activeWorkbookIds + notSubscribeWorkbookIds + inActiveList
for (i in expectedOrderedWorkbookIds.indices) {
assertEquals(expectedOrderedWorkbookIds[i].toLong(), orderedWorkbooks.workbooks[i].id)
assertEquals(expectedOrderedWorkbookIds[i].toLong(), orderedWorkbooks.workbooks.workbookData[i].id)
}
}

Expand Down Expand Up @@ -118,12 +119,12 @@ class AuthMainViewWorkbookOrderDelegatorTest {
)

// then
val orderedWorkbooks = delegator.order(workbooksOrderBySubscriptionCount)
assertEquals(totalWorkbookCount, orderedWorkbooks.workbooks.size)
val orderedWorkbooks = delegator.order(OrderTargetWorkBooks(WorkBooks(workbooksOrderBySubscriptionCount)))
assertEquals(totalWorkbookCount, orderedWorkbooks.workbooks.workbookData.size)

val expectedOrderedWorkbookIds = activeWorkbookIds + notSubscribeWorkbookIds
for (i in expectedOrderedWorkbookIds.indices) {
assertEquals(expectedOrderedWorkbookIds[i].toLong(), orderedWorkbooks.workbooks[i].id)
assertEquals(expectedOrderedWorkbookIds[i].toLong(), orderedWorkbooks.workbooks.workbookData[i].id)
}
}

Expand Down Expand Up @@ -177,12 +178,12 @@ class AuthMainViewWorkbookOrderDelegatorTest {
)

// then
val orderedWorkbooks = delegator.order(workbooksOrderBySubscriptionCount)
assertEquals(totalWorkbookCount, orderedWorkbooks.workbooks.size)
val orderedWorkbooks = delegator.order(OrderTargetWorkBooks(WorkBooks(workbooksOrderBySubscriptionCount)))
assertEquals(totalWorkbookCount, orderedWorkbooks.workbooks.workbookData.size)

val expectedOrderedWorkbookIds = notSubscribeWorkbookIds + inActiveWorkbookIds
for (i in expectedOrderedWorkbookIds.indices) {
assertEquals(expectedOrderedWorkbookIds[i].toLong(), orderedWorkbooks.workbooks[i].id)
assertEquals(expectedOrderedWorkbookIds[i].toLong(), orderedWorkbooks.workbooks.workbookData[i].id)
}
}
}

0 comments on commit d24e5d3

Please sign in to comment.