• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rwjdk / TrelloDotNet / 7308990850

23 Dec 2023 03:12PM UTC coverage: 63.815% (-2.5%) from 66.31%
7308990850

push

github

rwjdk
v1.9.7

890 of 1733 branches covered (0.0%)

Branch coverage included in aggregate %.

5 of 128 new or added lines in 7 files covered. (3.91%)

2 existing lines in 2 files now uncovered.

2332 of 3316 relevant lines covered (70.33%)

54.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/TrelloDotNet/TrelloDotNet/Model/ChecklistExtensions.cs
1
using System.Collections.Generic;
2
using System.Linq;
3

4
namespace TrelloDotNet.Model
5
{
6
    /// <summary>
7
    /// A set of handy extension methods for Checklists
8
    /// </summary>
9
    public static class ChecklistExtensions
10
    {
11
        /// <summary>
12
        /// Get Number of Items on the Checklist regardless of state
13
        /// </summary>
14
        /// <returns>Number of Items</returns>
15
        public static int GetNumberOfItems(this Checklist checklist)
16
        {
NEW
17
            return checklist.Items.Count;
×
18
        }
19

20
        /// <summary>
21
        /// Get the Number of Completed items on the Checklist
22
        /// </summary>
23
        /// <returns>Number of Completed Items</returns>
24
        public static int GetNumberOfCompletedItems(this Checklist checklist)
25
        {
NEW
26
            return checklist.Items.Count(x => x.State == ChecklistItemState.Complete);
×
27
        }
28

29
        /// <summary>
30
        /// Get the Number of Incomplete items on the Checklist
31
        /// </summary>
32
        /// <returns>Number of Completed Items</returns>
33
        public static int GetNumberOfIncompleteItems(this Checklist checklist)
34
        {
NEW
35
            return checklist.Items.Count(x => x.State == ChecklistItemState.Incomplete);
×
36
        }
37

38
        /// <summary>
39
        /// Returns if all items on the Checklist is complete
40
        /// </summary>
41
        /// <returns>True if all Items are complete</returns>
42
        public static bool IsAllComplete(this Checklist checklist)
43
        {
NEW
44
            return checklist.Items.All(x => x.State == ChecklistItemState.Complete);
×
45
        }
46

47
        /// <summary>
48
        /// Returns if any of the checklist items ar not yet complete
49
        /// </summary>
50
        /// <returns>True if on or more is incomplete</returns>
51
        public static bool IsAnyIncomplete(this Checklist checklist)
52
        {
NEW
53
            return checklist.Items.Any(x => x.State != ChecklistItemState.Complete);
×
54
        }
55

56
        /// <summary>
57
        /// Get Number of Items across a collection of Checklists regardless of state
58
        /// </summary>
59
        /// <returns>Number of Items</returns>
60
        public static int GetNumberOfItems(this IEnumerable<Checklist> checklists)
61
        {
NEW
62
            return checklists.Sum(x => x.GetNumberOfItems());
×
63
        }
64

65
        /// <summary>
66
        /// Get the Number of Completed items across a collection of Checklists
67
        /// </summary>
68
        /// <returns>Number of Completed Items</returns>
69
        public static int GetNumberOfCompletedItems(this IEnumerable<Checklist> checklists)
70
        {
NEW
71
            return checklists.Sum(x => x.GetNumberOfCompletedItems());
×
72
        }
73

74
        /// <summary>
75
        /// Get the Number of Incomplete items across a collection of Checklists
76
        /// </summary>
77
        /// <returns>Number of Completed Items</returns>
78
        public static int GetNumberOfIncompleteItems(this IEnumerable<Checklist> checklists)
79
        {
NEW
80
            return checklists.Sum(x => x.GetNumberOfIncompleteItems());
×
81
        }
82

83
        /// <summary>
84
        /// Returns if all items on the Checklist is complete
85
        /// </summary>
86
        /// <returns>True if all Items are complete</returns>
87
        public static bool IsAllComplete(this IEnumerable<Checklist> checklists)
88
        {
NEW
89
            return checklists.All(x => x.IsAllComplete());
×
90
        }
91

92
        /// <summary>
93
        /// Returns if any of the checklist items ar not yet complete
94
        /// </summary>
95
        /// <returns>True if on or more is incomplete</returns>
96
        public static bool IsAnyIncomplete(this IEnumerable<Checklist> checklists)
97
        {
NEW
98
            return checklists.Any(x => x.IsAnyIncomplete());
×
99
        }
100
    }
101
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc