Skip to content

Instantly share code, notes, and snippets.

@shiraji
Created August 21, 2017 02:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shiraji/36dc56a046dac103915f38b3293607ca to your computer and use it in GitHub Desktop.
Save shiraji/36dc56a046dac103915f38b3293607ca to your computer and use it in GitHub Desktop.
@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)
}
}
}
@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")
}
@shiraji
Copy link
Author

shiraji commented Aug 21, 2017

今回の場合、自分はネストが嫌いなので、変数のみ(variables.kt)で書くと思います。

with-withのネストは多分やらないです。
let-letのネストなら上記の変数に入れる手法でいきます。

完全に個人の嗜好なので、何が正解なのかわかりませんが。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment