2 ms·
YAGNI Refactor when those things are needed, right now the cooking process is stick it in a warm over for x minutes. What are you testing there? The oven was
by jpc0 3y ago
YAGNI
Refactor when those things are needed, right now the cooking process is stick it in a warm over for x minutes.
What are you testing there?
The oven was preheated? Put in an assert, that doesn't need a test.
That it stayed in for x minutes? You assuming the builtin sleep function is broken? Don't test library code, that's not your job.
That the oven actually preheated correctly, that was discussed in the article, the oven and it's preheat method should be a dependency that gets passed in, again not needed to be tested here.
Also in your example you are testing whether an if condition was evaluated as true.
Give me an example of a stuffed crust pizza cooking process that has a unit test which cannot be checked by looking at the resulting pizza.