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

Commit 438e796

Browse files
committed
デフォルト値を用いたマッピングテストを追加
1 parent 4d947f1 commit 438e796

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.mapk.kmapper
2+
3+
import com.mapk.annotations.KUseDefaultArgument
4+
import org.junit.jupiter.api.Assertions.assertEquals
5+
import org.junit.jupiter.api.DisplayName
6+
import org.junit.jupiter.api.Test
7+
8+
@DisplayName("デフォルト引数を指定するテスト")
9+
class DefaultArgumentTest {
10+
data class Dst(val fooArgument: Int, @param:KUseDefaultArgument val barArgument: String = "default")
11+
data class Src(val fooArgument: Int, val barArgument: String)
12+
13+
@Test
14+
fun test() {
15+
val src = Src(1, "src")
16+
17+
val result = KMapper(::Dst).map(src)
18+
assertEquals(Dst(1, "default"), result)
19+
}
20+
}

0 commit comments

Comments
 (0)