Scaling shapes
No. 166
Q: |
We want shapes to become scalable: In the above example the rectangle is being shrunk to
50% of its original size whereas the circle's radius is being
doubled. Add a corresponding
Provide appropriate unit tests. |
A: |
This task is pretty much straightforward. Since scaling
requires specific details (like radius or width and height) a
This method has to be implemented in our two concrete
classes Sensible unit tests may be based on the observation that:
|