다음은 액터 내부에서 파사드의 메서드(getToDoList)를 어떻게 사용할 수 있을까 하는 문제다. 한 가지 가능성은 액터의 메서드에 ApplicationForAT를 파라미터로 전달하는 것이다.
class ToDoListOwner(override val name: String) : ScenarioActor {
fun canSeeTheList(listName: String,
items: List<String>,
app: ApplicationForAT) { ➊
val expectedList = createList(listName, items)
val list = app.getToDoList(name, listName)
expectThat(list).isEqualTo(expectedList)
}
fun cannotSeeTheList(listName: String,
app: ApplicationForAT) { ➋
expectThrows<AssertionFailedError> {
app.getToDoList(name, listName)
}
}
}
➊ 애플리케이션 파사드를 새 파라미터로 추가했다.
➋ 여기도 마찬가지로 추가했다.