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

rwjdk / TrelloDotNet / 12973172764

26 Jan 2025 09:02AM UTC coverage: 56.133% (-0.8%) from 56.91%
12973172764

push

github

rwjdk
Version .1.11.9 (Last planned 1.x release)

933 of 1996 branches covered (46.74%)

Branch coverage included in aggregate %.

137 of 384 new or added lines in 21 files covered. (35.68%)

20 existing lines in 4 files now uncovered.

2449 of 4029 relevant lines covered (60.78%)

49.17 hits per line

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

0.0
/src/TrelloDotNet/Model/Options/AddCardOptions/AddCardOptionsCustomField.cs
1
using System;
2

3
namespace TrelloDotNet.Model.Options.AddCardOptions
4
{
5
    /// <summary>
6
    /// Add Card Option for a Custom Field value
7
    /// </summary>
8
    public class AddCardOptionsCustomField
9
    {
NEW
10
        internal CustomField Field { get; }
×
NEW
11
        internal object Value { get; set; }
×
12

13
        /// <summary>
14
        /// Constructor
15
        /// </summary>
16
        /// <param name="field">Custom Field to set</param>
17
        /// <param name="value">Value to set</param>
NEW
18
        public AddCardOptionsCustomField(CustomField field, string value)
×
19
        {
NEW
20
            if (field.Type != CustomFieldType.Text)
×
21
            {
NEW
22
                throw new TrelloApiException($"Incorrect value type for Custom Field '{field.Name}' as it is not a string based field", string.Empty);
×
23
            }
24

NEW
25
            Field = field;
×
NEW
26
            Value = value;
×
NEW
27
        }
×
28

29

30
        /// <summary>
31
        /// Constructor
32
        /// </summary>
33
        /// <param name="field">Custom Field to set</param>
34
        /// <param name="value">Value to set</param>
NEW
35
        public AddCardOptionsCustomField(CustomField field, DateTimeOffset value)
×
36
        {
NEW
37
            if (field.Type != CustomFieldType.Date)
×
38
            {
NEW
39
                throw new TrelloApiException($"Incorrect value type for Custom Field '{field.Name}' as it is not a Date based field", string.Empty);
×
40
            }
41

NEW
42
            Field = field;
×
NEW
43
            Value = value;
×
NEW
44
        }
×
45

46

47
        /// <summary>
48
        /// Constructor
49
        /// </summary>
50
        /// <param name="field">Custom Field to set</param>
51
        /// <param name="value">Value to set</param>
NEW
52
        public AddCardOptionsCustomField(CustomField field, bool value)
×
53
        {
NEW
54
            if (field.Type != CustomFieldType.Checkbox)
×
55
            {
NEW
56
                throw new TrelloApiException($"Incorrect value type for Custom Field '{field.Name}' as it is not a Boolean based field", string.Empty);
×
57
            }
58

NEW
59
            Field = field;
×
NEW
60
            Value = value;
×
NEW
61
        }
×
62

63

64
        /// <summary>
65
        /// Constructor
66
        /// </summary>
67
        /// <param name="field">Custom Field to set</param>
68
        /// <param name="value">Value to set</param>
NEW
69
        public AddCardOptionsCustomField(CustomField field, decimal value)
×
70
        {
NEW
71
            if (field.Type != CustomFieldType.Number)
×
72
            {
NEW
73
                throw new TrelloApiException($"Incorrect value type for Custom Field '{field.Name}' as it is not a Number based field", string.Empty);
×
74
            }
75

NEW
76
            Field = field;
×
NEW
77
            Value = value;
×
NEW
78
        }
×
79

80

81
        /// <summary>
82
        /// Constructor
83
        /// </summary>
84
        /// <param name="field">Custom Field to set</param>
85
        /// <param name="value">Value to set</param>
NEW
86
        public AddCardOptionsCustomField(CustomField field, int value)
×
87
        {
NEW
88
            if (field.Type != CustomFieldType.Number)
×
89
            {
NEW
90
                throw new TrelloApiException($"Incorrect value type for Custom Field '{field.Name}' as it is not a Number based field", string.Empty);
×
91
            }
92

NEW
93
            Field = field;
×
NEW
94
            Value = value;
×
NEW
95
        }
×
96

97

98
        /// <summary>
99
        /// Constructor
100
        /// </summary>
101
        /// <param name="field">Custom Field to set</param>
102
        /// <param name="value">Value to set</param>
NEW
103
        public AddCardOptionsCustomField(CustomField field, CustomFieldOption value)
×
104
        {
NEW
105
            if (field.Type != CustomFieldType.List)
×
106
            {
NEW
107
                throw new TrelloApiException($"Incorrect value type for Custom Field '{field.Name}' as it is not a Option based field", string.Empty);
×
108
            }
109

NEW
110
            Field = field;
×
NEW
111
            Value = value;
×
NEW
112
        }
×
113
    }
114
}
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

© 2026 Coveralls, Inc