sam
04/29/2020, 10:35 PMtrait CustomMatchers {
def title(expectedValue: String) =
new HavePropertyMatcher[Book, String] {
def apply(book: Book) =
HavePropertyMatchResult(
book.title == expectedValue,
"title",
expectedValue,
book.title
)
}
def author(expectedValue: String) =
new HavePropertyMatcher[Book, String] {
def apply(book: Book) =
HavePropertyMatchResult(
book.author == expectedValue,
"author",
expectedValue,
book.author
)
}
}