Skip to content

Add ContainsOption and TrySelectOption to option widgets#66

Merged
ThomasRemmery merged 3 commits into10.6.3.Xfrom
try-select-option
Mar 25, 2026
Merged

Add ContainsOption and TrySelectOption to option widgets#66
ThomasRemmery merged 3 commits into10.6.3.Xfrom
try-select-option

Conversation

@TomW-Skyline
Copy link
Copy Markdown
Member

@TomW-Skyline TomW-Skyline commented Mar 25, 2026

Introduce ContainsOption and TrySelectOption methods to dropdown, radio button, and checkbox list widgets (generic and non-generic). These methods allow checking for the existence of options and safely attempting selection. Updated interfaces, implementations, and XML docs to improve API consistency and usability.

AB#41138

Introduce ContainsOption and TrySelectOption methods to dropdown, radio button, and checkbox list widgets (generic and non-generic). These methods allow checking for the existence of options and safely attempting selection. Updated interfaces, implementations, and XML docs to improve API consistency and usability.
@ThomasRemmery
Copy link
Copy Markdown
Collaborator

@copilot can you review the PR?

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 25, 2026

@copilot can you review the PR?

Here's the review summary with the issues found and fixed (commit 728caff):

Issues fixed:

  1. Incomplete XML docs on TrySelectOption — Added <param> and <returns> tags to all TrySelectOption method signatures in IDropDown and IRadioButtonList. The ContainsOption methods already had them; TrySelectOption was missing them.

  2. Inconsistent null checks for generic T value parametersContainsOption(T value) and TrySelectOption(T value) in the generic implementations threw ArgumentNullException for null, but the existing RemoveOption(T value) doesn't. This is also problematic for value types where value == null is unreachable. Removed to align with the rest of the codebase.

  3. Missing unit tests — No tests existed for the new methods. Added tests covering exists/not-exists cases and null-argument guard cases across all affected widget types (DropDownTests, CheckBoxListTests, additions to GenericDropDownTests, GenericRadioButtonListTests, GenericCheckBoxListTests, RadioButtonListTests).

No other issues found. Implementation is correct: ContainsOption properly delegates to the underlying collection, TrySelectOption correctly reuses ContainsOption before assigning, and the Option<T> overloads still retain null guards since Option<T> is a reference type.

@ThomasRemmery ThomasRemmery merged commit fe3e808 into 10.6.3.X Mar 25, 2026
11 checks passed
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.

3 participants