Collection-Based Matchers

Learn about DSL in ScalaTest by writing assertions on collections.

Collections

In this lesson, we’ll work with collections and collection-based assertions. We’ll start by extending our code a bit and implementing functionality to add and delete a course. When adding a course, we want its title to be unique. Similarly, we want to avoid duplicates when adding lessons and tags to a course. The latter can be achieved by replacing Seq with Set. The former is a bit trickier.

Get hands-on with 1200+ tech skills courses.