Skip to content
This repository was archived by the owner on Jan 20, 2023. It is now read-only.

Commit da277f8

Browse files
committed
PlainKMapperに関する再帰的マッピングのテストを追加
1 parent f854eba commit da277f8

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/test/kotlin/com/mapk/kmapper/RecursiveMappingTest.kt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,33 @@ class RecursiveMappingTest {
6363
}
6464
}
6565

66+
@Nested
67+
@DisplayName("PlainKMapper")
68+
inner class PlainKMapperTest {
69+
@Test
70+
@DisplayName("シンプルなマッピング")
71+
fun test() {
72+
val actual = PlainKMapper(::Dst).map(src)
73+
assertEquals(expected, actual)
74+
}
75+
76+
@Test
77+
@DisplayName("スネークケースsrc -> キャメルケースdst")
78+
fun snakeToCamel() {
79+
val actual = PlainKMapper(::Dst) {
80+
CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, it)
81+
}.map(snakeSrc)
82+
assertEquals(expected, actual)
83+
}
84+
85+
@Test
86+
@DisplayName("内部フィールドがMapの場合")
87+
fun includesMap() {
88+
val actual = PlainKMapper(::Dst).map(mapSrc)
89+
assertEquals(expected, actual)
90+
}
91+
}
92+
6693
@Nested
6794
@DisplayName("BoundKMapper")
6895
inner class BoundKMapperTest {

0 commit comments

Comments
 (0)