
363
17
장
목에서 맵으로
listOf(
FeaturedDestinationSuggestion(froyle, flowerFarm, 0),
FeaturedDestinationSuggestion(alton, watercressLine, 320)
),
recommendations.recommendationsFor(setOf(alton, froyle))
)
}
약간의 노력을 기울이면 다음과 같이 코드를 바꿀 수 있다.
예제
17.15
[
mocks
-
to
-
maps
.
4
:
src
/
test
/
java
/
travelator
/
recommendations
/
RecommendationsTests
.
kt
]
@Test
fun deduplicates_using_smallest_distance() {
givenFeaturedDestinationsFor(alton, of(flowerFarm, watercressLine))
givenADistanceFrom(alton, to = flowerFarm, of = 5300)
givenADistanceFrom(alton, to = watercressLine, of = 320)
givenFeaturedDestinationsFor(froyle, of(flowerFarm, watercressLine))
givenADistanceFrom(froyle, ...