< Summary - PropertyGridHelpers Code Coverage

Information
Class: PropertyGridHelpers.Controls.FlagCheckedListBoxItem
Assembly: PropertyGridHelpers
File(s): C:\Agent\_work\2\s\Code\PropertyGridHelpers\Controls\FlagCheckedListBoxItem.cs
Tag: PropertyGridHelpers Build_2026.1.11.1_#580
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 42
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 3/4/2025 - 9:39:23 PM Line coverage: 100% (12/12) Branch coverage: 100% (6/6) Total lines: 73 Tag: PropertyGridHelpers Build_2025.3.4.1_#3775/22/2025 - 7:52:21 PM Line coverage: 100% (12/12) Branch coverage: 100% (6/6) Total lines: 73 Tag: PropertyGridHelpers Build_2025.5.22.1_#4175/23/2025 - 7:21:57 PM Line coverage: 100% (12/12) Branch coverage: 100% (6/6) Total lines: 73 Tag: Test PropertyGridHelpers Build_2025.5.23.2_#4265/28/2025 - 8:07:03 PM Line coverage: 100% (12/12) Branch coverage: 100% (6/6) Total lines: 73 Tag: PropertyGridHelpers Build_2025.5.28.1_#4286/3/2025 - 4:27:27 PM Line coverage: 100% (12/12) Branch coverage: 100% (6/6) Total lines: 73 Tag: Test PropertyGridHelpers Build_2025.6.3.1_#4336/3/2025 - 7:42:47 PM Line coverage: 100% (12/12) Branch coverage: 100% (6/6) Total lines: 73 Tag: PropertyGridHelpers Build_2025.6.3.2_#4396/12/2025 - 9:38:24 PM Line coverage: 100% (7/7) Branch coverage: 100% (4/4) Total lines: 41 Tag: PropertyGridHelpers Build_2025.6.12.2_#4567/4/2025 - 11:01:20 PM Line coverage: 100% (5/5) Branch coverage: 100% (4/4) Total lines: 42 Tag: PropertyGridHelpers Build_2025.7.4.1_#477 3/4/2025 - 9:39:23 PM Line coverage: 100% (12/12) Branch coverage: 100% (6/6) Total lines: 73 Tag: PropertyGridHelpers Build_2025.3.4.1_#3775/22/2025 - 7:52:21 PM Line coverage: 100% (12/12) Branch coverage: 100% (6/6) Total lines: 73 Tag: PropertyGridHelpers Build_2025.5.22.1_#4175/23/2025 - 7:21:57 PM Line coverage: 100% (12/12) Branch coverage: 100% (6/6) Total lines: 73 Tag: Test PropertyGridHelpers Build_2025.5.23.2_#4265/28/2025 - 8:07:03 PM Line coverage: 100% (12/12) Branch coverage: 100% (6/6) Total lines: 73 Tag: PropertyGridHelpers Build_2025.5.28.1_#4286/3/2025 - 4:27:27 PM Line coverage: 100% (12/12) Branch coverage: 100% (6/6) Total lines: 73 Tag: Test PropertyGridHelpers Build_2025.6.3.1_#4336/3/2025 - 7:42:47 PM Line coverage: 100% (12/12) Branch coverage: 100% (6/6) Total lines: 73 Tag: PropertyGridHelpers Build_2025.6.3.2_#4396/12/2025 - 9:38:24 PM Line coverage: 100% (7/7) Branch coverage: 100% (4/4) Total lines: 41 Tag: PropertyGridHelpers Build_2025.6.12.2_#4567/4/2025 - 11:01:20 PM Line coverage: 100% (5/5) Branch coverage: 100% (4/4) Total lines: 42 Tag: PropertyGridHelpers Build_2025.7.4.1_#477

Metrics

MethodBlocks covered Blocks not covered Branch coverage Crap Score Cyclomatic complexity Line coverage
FlagCheckedListBoxItem(...)20----
.ctor(...)--100%11100%
get_IsFlag()--100%11100%
IsMemberFlag(...)90100%44100%

File(s)

C:\Agent\_work\2\s\Code\PropertyGridHelpers\Controls\FlagCheckedListBoxItem.cs

#LineLine coverage
 1namespace PropertyGridHelpers.Controls
 2{
 3    /// <summary>
 4    /// Represents an item displayed in a checklist box for editing bitwise
 5    /// enum values (flags). This item stores both the integer flag value
 6    /// and a user-friendly caption.
 7    /// </summary>
 8    public class FlagCheckedListBoxItem : ItemWrapper<int>
 9    {
 10        /// <summary>
 11        /// Initializes a new instance of the <see cref="FlagCheckedListBoxItem"/> class
 12        /// with the specified flag value and display caption.
 13        /// </summary>
 14        /// <param name="value">The integer value representing the flag.</param>
 15        /// <param name="caption">The caption displayed to the user.</param>
 30416        public FlagCheckedListBoxItem(int value, string caption) : base(caption, value)
 29617        {
 30418        }
 19
 20        /// <summary>
 21        /// Gets a value indicating whether this item represents a
 22        /// single flag (a single bit set).
 23        /// </summary>
 24        /// <value>
 25        /// <c>true</c> if this value has exactly one bit set; otherwise, <c>false</c>.
 26        /// </value>
 27        public bool IsFlag =>
 4828            (Value & (Value - 1)) == 0;
 29
 30        /// <summary>
 31        /// Determines whether this flag item is a member of the specified composite flag value.
 32        /// </summary>
 33        /// <param name="composite">
 34        /// A <see cref="FlagCheckedListBoxItem"/> representing the composite flags to test against.
 35        /// </param>
 36        /// <returns>
 37        /// <c>true</c> if this flag is included in the composite; otherwise, <c>false</c>.
 38        /// </returns>
 39        public bool IsMemberFlag(FlagCheckedListBoxItem composite) =>
 4440            composite != null && IsFlag && ((Value & composite.Value) == Value);
 41    }
 42}