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

rwjdk / TrelloDotNet / 13544206255

26 Feb 2025 12:46PM UTC coverage: 41.646% (-0.2%) from 41.845%
13544206255

push

github

rwjdk
Preview 3

956 of 3225 branches covered (29.64%)

Branch coverage included in aggregate %.

0 of 33 new or added lines in 4 files covered. (0.0%)

2474 of 5011 relevant lines covered (49.37%)

42.33 hits per line

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

0.0
/src/TrelloDotNet/Model/PluginDataExtensions.cs
1
using System.Linq;
2
using System.Text.Json;
3

4
namespace TrelloDotNet.Model
5
{
6
    /// <summary>
7
    /// Extensions for PluginData
8
    /// </summary>
9
    public static class PluginDataExtensions
10
    {
11
        /// <summary>
12
        /// Cast the Value of PluginData to a custom PluginData Model
13
        /// </summary>
14
        /// <typeparam name="T">The Custom Model with JsonPropertyName() on each Property</typeparam>
15
        /// <param name="pluginData">The generic PluginData</param>
16
        /// <param name="pluginId">The Id of the Plugin</param>
17
        /// <returns></returns>
18
        public static T Cast<T>(this System.Collections.Generic.List<PluginData> pluginData, string pluginId)
19
        {
NEW
20
            PluginData firstOrDefault = pluginData.FirstOrDefault(x => x.PluginId == pluginId);
×
NEW
21
            if (firstOrDefault == null)
×
22
            {
NEW
23
                return default;
×
24
            }
25

NEW
26
            return Cast<T>(firstOrDefault);
×
27
        }
28

29
        /// <summary>
30
        /// Cast the Value of PluginData to a custom PluginData Model
31
        /// </summary>
32
        /// <param name="pluginData">The generic PluginData</param>
33
        /// <typeparam name="T">The Custom Model with JsonPropertyName() on each Property</typeparam>
34
        /// <returns></returns>
35
        public static T Cast<T>(this PluginData pluginData)
36
        {
NEW
37
            if (pluginData == null)
×
38
            {
NEW
39
                return default;
×
40
            }
41

NEW
42
            return JsonSerializer.Deserialize<T>(pluginData.Value);
×
43
        }
44
    }
45
}
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