File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,14 @@ Each shape must be drawn in a different color.
3434
3535> Don't forget to add the dependencies in your Cargo.toml.
3636
37+ ### Unit Tests
38+
39+ You must implement unit tests within your ` geometrical_shapes ` module to ensure your logic is sound. Specifically, your tests should:
40+
41+ - Verify that ` random ` functions never produce points outside the specified image dimensions.
42+ - Verify that shapes (like ` Rectangle ` ) are correctly initialized even if the points are provided in reverse order.
43+ - Test edge cases, such as a line where both points are at the same coordinate.
44+
3745### Bonus
3846
3947You may optionally implement the following shapes, including the structures and traits needed to draw them:
Original file line number Diff line number Diff line change 1818
1919###### Are the shapes drawn with different colors?
2020
21+ #### Unit Tests
22+
23+ ##### Run the command ` cargo test ` .
24+
25+ ###### Do all tests pass without errors?
26+
27+ ###### Are there specific tests for the ` random ` function bounds (e.g., checking that points stay within the image width/height)?
28+
29+ ###### Are there tests for shape initialization, such as checking if a ` Rectangle ` handles inverted coordinates correctly?
30+
2131#### Bonus
2232
2333###### +Can you draw a pentagon?
You can’t perform that action at this time.
0 commit comments