Skip to content

Phongsakon/feature/ci align#7

Merged
phomarkon merged 5 commits into
phongsakon/developfrom
phongsakon/feature/ci-align
Jun 11, 2026
Merged

Phongsakon/feature/ci align#7
phomarkon merged 5 commits into
phongsakon/developfrom
phongsakon/feature/ci-align

Conversation

@phomarkon

Copy link
Copy Markdown
Collaborator

No description provided.

phomarkon added 5 commits May 31, 2026 05:14
The six AlignAction subclasses each repeated the same loop over the
selected figures and only differed in how they computed the translation.
Extracted the varying geometry into an Alignment enum and pulled the
shared loop up into the base class as a template method. Subclasses now
just carry their Alignment value. Behaviour is unchanged, existing
callers in ButtonFactory and AlignToolBar still compile.
Second half of the change request. Distribute spreads the selected
figures so the gaps between them are equal, horizontally or vertically.
Follows the same shape as AlignAction, a thin action delegating the
geometry to a Distribution enum, so it reuses the template method the
refactoring put in place. Wired the buttons into ButtonFactory and added
the labels next to the alignment ones.
Added JUnit 4 next to the existing TestNG so the lab's framework is in
place without disturbing the current tests. The tests cover the pure
geometry the refactoring exposed: 9 cases for Alignment, one per
direction plus the already-aligned and oversized-figure boundaries, and
6 for Distribution, the equal-gap best case plus the two and one figure
boundaries where it must do nothing. All 15 green.
Mapped the user story to Given-When-Then scenarios with JGiven and
AssertJ. One stage holds the steps, and the three scenarios cover the
story's promises: aligning north lines up the top edges, distributing
makes the gaps equal, and distributing two figures changes nothing.
GitHub Actions pipeline that builds all modules and runs the tests on
JDK 11 for every pull request. Named ci-align.yml so it does not clash
with the ci.yml a teammate added on another branch.
@phomarkon phomarkon requested a review from AltanEsmer June 4, 2026 12:10
@phomarkon phomarkon self-assigned this Jun 4, 2026
@phomarkon phomarkon added the enhancement New feature or request label Jun 4, 2026
@phomarkon phomarkon merged commit f2b2495 into phongsakon/develop Jun 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant