diff --git a/Test/test_matrixmania/test_projection.py b/Test/test_matrixmania/test_projection.py new file mode 100644 index 0000000..2be487a --- /dev/null +++ b/Test/test_matrixmania/test_projection.py @@ -0,0 +1,36 @@ +"""Machine tests for the orthographic projection in compute.py. + +Every test is structured according to the +Arrange - Act - Assert pattern. +""" + +import pytest + +from compute import project_ortho + + +def test_project_ortho_without_scale() -> None: + """project_ortho drops z and returns (x, y) unchanged.""" + # Arrange + point = (1.0, 2.0, 3.0) + expected = (1.0, 2.0) + + # Act + result = project_ortho(point) + + # Assert + assert result == pytest.approx(expected) + + +def test_project_ortho_with_scale_100() -> None: + """project_ortho with scale=100 scales the projected point.""" + # Arrange + point = (1.0, 2.0, 3.0) + scale = 100 + expected = (100.0, 200.0) + + # Act + result = project_ortho(point, scale) + + # Assert + assert result == pytest.approx(expected) \ No newline at end of file