Came here to say exactly that. The author is advocating for mockist style of unit testing, which is quite terrible for many, many reasons. What you are describing is classic unit testing, and this is the way to go.
> The author is advocating for mockist style of unit testing
IMO: "mockist" style of unit tests are best for corner cases that can only be tested in isolation. For example, error conditions that are important to verify, but so difficult or impossible to test that the only way to test them is to test a single class in isolation.
Good article and book about it:
- https://enterprisecraftsmanship.com/posts/unit-testing-depen...
- Unit Testing Principles, Practices, and Patterns