Add tests for BannerPreference button parceling
The existing test for parceling `BannerPreference` was flawed and did not correctly verify the button information after being unparceled. This change corrects the existing test and adds more comprehensive tests for parceling logic.
- Corrected `parcelOperation` test to compare button properties (e.g., label) instead of object references, as `ButtonInfo` does not override `equals()`.
- Renamed the test to `parcelOperation_withAllFields` for clarity.
- Added new tests to cover edge cases:
- `parcelOperation_withNullButtons`: Verifies behavior when no buttons are set.
- `parcelOperation_withOnlyPositiveButton`: Verifies behavior with only a positive button.
- `parcelOperation_withOnlyNegativeButton`: Verifies behavior with only a negative button.
These changes ensure the parceling mechanism for positive and negative buttons is robust and correctly handled.
Please help fill out the survey for feedback: https://docs.google.com/forms/d/e/1FAIpQLSeKFKpHImCAqZIa_OR801cw72HQUreM2oGM25C3mKKT2tBFnw/viewform?usp=pp_url&entry.1586624956=ag/35459490
Please feel free to use your domain knowledge to make changes to the generated tests to make it more valuable for your team.
Original Change: ag/35284769 (Note tests are based on the original CL but may add coverage beyond the specific changes to improve overall code health)
Test: ATP tests passed http://go/forrest-run/L80300030017584005
Bug: 431235865
Flag: TEST_ONLY
Change-Id: I0720b4a15ae8431475a89be0d7f5766895c888f7
Loading
Please register or sign in to comment