Skip to content

Add 18 equals() test cases for Day class#460

Open
lmj798 wants to merge 3 commits intojfree:masterfrom
lmj798:master
Open

Add 18 equals() test cases for Day class#460
lmj798 wants to merge 3 commits intojfree:masterfrom
lmj798:master

Conversation

@lmj798
Copy link

@lmj798 lmj798 commented Mar 4, 2026

Summary

Add comprehensive test coverage for the Day.equals(Object) method with 18 test cases covering reflexivity, symmetry, consistency, null/non-Day object comparisons, date differences, and boundary cases (1900-9999) to improve behavioral stability and prevent regressions.

Why

Current tests for Day.equals(Object) are minimal and do not explicitly cover critical equality contract requirements and boundary cases. These scenarios are easy to regress (e.g., through changes to comparison logic or type checking), so explicit tests improve behavioral stability and ensure proper implementation of the equals contract.

Verification

Ran mvn -Dtest=DayTest test
Result: all tests passed

lmj798 and others added 3 commits March 4, 2026 16:33
Added comprehensive tests for Day.equals(Object) method, covering reflexivity, equality, null comparison, and date differences.
## Summary
Add 11 new test methods to verify the behavior of MultiplePiePlot.setPieChart(JFreeChart).
Add tests covering normal path validation, null parameter handling, invalid plot type rejection, 
multiple consecutive sets with error checking, dataset preservation, and exception message format validation.
Add boundary edge case testing for null datasets and verify state immutability on failed operations.
## Why
Existing tests completely lacked coverage for the setPieChart() method, which is a critical 
public API for configuring the pie chart template used by MultiplePiePlot. The method has 
multiple validation checks (null checks, type validation) and state management logic that 
could regress without explicit test coverage. These tests provide early detection for potential 
issues like incorrect exception handling, state corruption on failed calls, or changes to 
type validation. Exception message format tests also validate error messaging contract compliance.
## Verification
Ran mvn clean test -Dtest=MultiplePiePlotTest
Result: Tests run: 16 (5 existing + 11 new), Failures: 0, Errors: 0, Skipped: 0
Removed tests related to setting pie charts in MultiplePiePlot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant