Created
August 21, 2017 02:34
-
-
Save shiraji/36dc56a046dac103915f38b3293607ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Throws(Exception::class) | |
fun hour10minute10_answer115degree2() { | |
"10:10".let { time -> | |
GetClockHandsDegree(DegreeCalcService()).execute(time).let { | |
println("(degree-min (clock-degree (clock-str \"$time\")) -> ${it.value} == 115") | |
Assert.that(it.value == 115, | |
"$time actual:${it.value} expected:" + 115) | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Throws(Exception::class) | |
fun hour10minute10_answer115degree() { | |
val expectedResult = 115 | |
val c = "10:10" | |
val result = GetClockHandsDegree(DegreeCalcService()).execute(c).value | |
println("(degree-min (clock-degree (clock-str \"$c\")) -> $result == $expectedResult") | |
Assert.that(result == expectedResult, "$c actual:$result expected:$expectedResult") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
今回の場合、自分はネストが嫌いなので、変数のみ(variables.kt)で書くと思います。
with-withのネストは多分やらないです。
let-letのネストなら上記の変数に入れる手法でいきます。
完全に個人の嗜好なので、何が正解なのかわかりませんが。。。