How to create test data with the Builder pattern

from blog Just Some Code, | ↗ original
Last time, we learned how to write good unit tests by reducing noise inside our tests. We used a factory method to simplify complex setup scenarios in our tests. Let’s use the Builder pattern to create test data for our unit tests. With the Builder pattern, an object creates another object. A builder has methods to change the state of an object...