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

rwjdk / TrelloDotNet / 15715919831

17 Jun 2025 07:01PM UTC coverage: 79.816% (-0.5%) from 80.303%
15715919831

push

github

rwjdk
Version 2.0.6

2539 of 3460 branches covered (73.38%)

Branch coverage included in aggregate %.

27 of 75 new or added lines in 9 files covered. (36.0%)

6 existing lines in 2 files now uncovered.

4480 of 5334 relevant lines covered (83.99%)

107.47 hits per line

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

22.22
/src/TrelloDotNet/Model/ListUpdate.cs
1
using System.Diagnostics;
2
using TrelloDotNet.Control;
3
using TrelloDotNet.Model.Options;
4

5
// ReSharper disable UnusedMember.Global
6
// ReSharper disable UnusedMember.Local
7

8
namespace TrelloDotNet.Model
9
{
10
    /// <summary>
11
    /// URI Parameter to build the URL
12
    /// </summary>
13
    [DebuggerDisplay("{_name} (Type: {_type})")]
14
    public class ListUpdate
15
    {
16
        private readonly object _valueAsObject;
17

18
        /// <summary>
19
        /// Name of the Parameter (found on Trello API reference page: https://developer.atlassian.com/cloud/trello/rest)
20
        /// </summary>
21
        private readonly string _name;
22

23
        /// <summary>
24
        /// Type of the parameter
25
        /// </summary>
26
        private readonly QueryParameterType _type;
27

28
        /// <summary>
29
        /// Create a Name Parameter
30
        /// </summary>
31
        /// <param name="value">Name</param>
32
        /// <returns>ListUpdate Object</returns>
33
        public static ListUpdate Name(string value) => new ListUpdate(ListFieldsType.Name, value ?? "");
1!
34

35
        /// <summary>
36
        /// Create a Closed Parameter
37
        /// </summary>
38
        /// <param name="value">Closed</param>
39
        /// <returns>ListUpdate Object</returns>
NEW
40
        public static ListUpdate Closed(bool value) => new ListUpdate(ListFieldsType.Closed, value);
×
41

42

43
        /// <summary>
44
        /// Create a Subscribed Parameter
45
        /// </summary>
46
        /// <param name="value">Description</param>
47
        /// <returns>ListUpdate Object</returns>
NEW
48
        public static ListUpdate Subscribed(bool value) => new ListUpdate(ListFieldsType.Subscribed, value);
×
49

50
        /// <summary>
51
        /// Create a Position Parameter
52
        /// </summary>
53
        /// <param name="value">Position</param>
54
        /// <returns>ListUpdate Object</returns>
NEW
55
        public static ListUpdate Position(decimal value) => new ListUpdate(ListFieldsType.Position, value);
×
56

57
        /// <summary>
58
        /// Create a Position Parameter
59
        /// </summary>
60
        /// <param name="value">Position</param>
61
        /// <returns>ListUpdate Object</returns>
NEW
62
        public static ListUpdate Position(NamedPosition value) => new ListUpdate(ListFieldsType.Position, value.GetJsonPropertyName());
×
63

64
        /// <summary>
65
        /// Create a Board Parameter
66
        /// </summary>
67
        /// <param name="value">Board</param>
68
        /// <returns>ListUpdate Object</returns>
NEW
69
        public static ListUpdate Board(string value) => new ListUpdate(ListFieldsType.BoardId, value);
×
70

71
        /// <summary>
72
        /// Create a Board Parameter
73
        /// </summary>
74
        /// <param name="value">Board</param>
75
        /// <returns>ListUpdate Object</returns>
NEW
76
        public static ListUpdate Board(Board value) => new ListUpdate(ListFieldsType.BoardId, value.Id);
×
77

78
        /// <summary>
79
        /// Create a Color Parameter
80
        /// </summary>
81
        /// <param name="value">Color</param>
82
        /// <returns>ListUpdate Object</returns>
NEW
83
        public static ListUpdate Color(ListColor? value) => new ListUpdate(ListFieldsType.Color, value?.GetJsonPropertyName() ?? ListColor.Gray.GetJsonPropertyName());
×
84

85
        /// <summary>
86
        /// Create an Additional Parameter (aka one that is not a named BoardFieldsType)
87
        /// </summary>
88
        /// <param name="additionalParameter">The Additional Parameter</param>
89
        /// <returns>ListUpdate Object</returns>
NEW
90
        public static ListUpdate AdditionalParameter(QueryParameter additionalParameter) => new ListUpdate(additionalParameter);
×
91

92
        /// <summary>
93
        /// Constructor
94
        /// </summary>
95
        /// <param name="parameter">The raw Parameter</param>
NEW
96
        private ListUpdate(QueryParameter parameter)
×
97
        {
NEW
98
            _name = parameter.Name;
×
NEW
99
            _type = parameter.Type;
×
NEW
100
            _valueAsObject = parameter.GetRawValue();
×
NEW
101
        }
×
102

103
        /// <summary>
104
        /// Constructor
105
        /// </summary>
106
        /// <param name="name">Name of the Parameter</param>
107
        /// <param name="value">Value of the Parameter</param>
108
        private ListUpdate(ListFieldsType name, string value)
1✔
109
        {
110
            _name = name.GetJsonPropertyName();
1✔
111
            _type = QueryParameterType.String;
1✔
112
            _valueAsObject = value;
1✔
113
        }
1✔
114

115
        /// <summary>
116
        /// Constructor
117
        /// </summary>
118
        /// <param name="name">Name of the Parameter</param>
119
        /// <param name="value">Value of the Parameter</param>
NEW
120
        private ListUpdate(ListFieldsType name, decimal? value)
×
121
        {
NEW
122
            _name = name.GetJsonPropertyName();
×
NEW
123
            _type = QueryParameterType.Decimal;
×
NEW
124
            _valueAsObject = value;
×
NEW
125
        }
×
126

127
        /// <summary>
128
        /// Constructor
129
        /// </summary>
130
        /// <param name="name">Name of the Parameter</param>
131
        /// <param name="value">Value of the Parameter</param>
NEW
132
        private ListUpdate(ListFieldsType name, bool? value)
×
133
        {
NEW
134
            _name = name.GetJsonPropertyName();
×
NEW
135
            _type = QueryParameterType.Boolean;
×
NEW
136
            _valueAsObject = value;
×
NEW
137
        }
×
138

139
        internal QueryParameter ToQueryParameter()
140
        {
141
            return new QueryParameter(_name, _type, _valueAsObject);
1✔
142
        }
143
    }
144
}
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