4 ms·
Both functions take an order and return a pizza. This seem perfect for testing. Why would you care where the oven comes from, if the function deliver perfectly
by bazoom42 3y ago
Both functions take an order and return a pizza. This seem perfect for testing.
Why would you care where the oven comes from, if the function deliver perfectly baked pizza? A unit test should test against the public interface and not be coupled to implementation details, since that will hamper refactorings.
> which make mocking really difficult.
Mocking is an antipattern anyway, and should be avoided except for nondeterministic components like current time or stateful external services.
- latchkey 3y ago[flagged]