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

DomCR / ACadSharp / 12812444789

16 Jan 2025 03:43PM UTC coverage: 75.915% (+0.2%) from 75.72%
12812444789

push

github

web-flow
Merge pull request #532 from DomCR/issue-531_extended-data-dxf-fix

Dxf xData

5261 of 7654 branches covered (68.74%)

Branch coverage included in aggregate %.

19 of 28 new or added lines in 3 files covered. (67.86%)

8 existing lines in 2 files now uncovered.

21010 of 26952 relevant lines covered (77.95%)

39207.88 hits per line

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

56.41
/src/ACadSharp/XData/ExtendedDataCollection.cs
1
using ACadSharp.Tables;
2
using System;
3
using System.Collections.Generic;
4
using System.Linq;
5

6
namespace ACadSharp.XData
7
{
8
        public class ExtendedDataDictionary
9
        {
10
                public IEnumerable<KeyValuePair<AppId, ExtendedData>> Entries { get { return this._data; } }
28,797✔
11

12
                public CadObject Owner { get; }
×
13

14
                private Dictionary<AppId, ExtendedData> _data = new Dictionary<AppId, ExtendedData>();
666,262✔
15

16
                public ExtendedDataDictionary(CadObject owner)
666,262✔
17
                {
666,262✔
18
                        this.Owner = owner;
666,262✔
19
                }
666,262✔
20

21
                public void Add(AppId app)
22
                {
×
23
                        this._data.Add(app, new ExtendedData(app));
×
24
                }
×
25
                /// <summary>
26
                /// Add ExtendedData for a specific AppId to the Dictionary.
27
                /// </summary>
28
                /// <param name="app">The AppId object.</param>
29
                /// <param name="records">The ExtendedData records.</param>
30
                public void Add(AppId app, IEnumerable<ExtendedDataRecord> records)
31
                {
22,713✔
32
                        this._data.Add(app, new ExtendedData(app, records));
22,713✔
33
                }
22,713✔
34

35
                /// <summary>
36
                /// Get ExtendedData for a specific AppId from the Dictionary.
37
                /// </summary>
38
                /// <param name="app">The AppId object.</param>
39
                public ExtendedData Get(AppId app)
40
                {
6✔
41
                        return this._data[app];
6✔
42
                }
6✔
43

44
                /// <summary>
45
                /// Try to get ExtendedData for a specific AppId from the Dictionary.
46
                /// </summary>
47
                /// <param name="app">The AppId object.</param>
48
                /// <param name="value">ExtendedData object.</param>
49
                public bool TryGet(AppId app, out ExtendedData value)
50
                {
×
51
                        return this._data.TryGetValue(app, out value);
×
52
                }
×
53

54
                public bool TryGet(string name, out ExtendedData value)
55
                {
26✔
56
                        AppId app = this._data.Keys.FirstOrDefault(k => k.Name == name);
52✔
57
                        if (app == null)
26!
NEW
58
                        {
×
NEW
59
                                value = null;
×
NEW
60
                                return false;
×
61
                        }
62

63
                        value = this._data[app];
26✔
64
                        return true;
26✔
65
                }
26✔
66

67
                /// <summary>
68
                /// Check whether a AppId is given in the Dictionary.
69
                /// </summary>
70
                /// <param name="app">The AppId object.</param>
71
                public bool ContainsKey(AppId app)
72
                {
×
73
                        return this._data.ContainsKey(app);
×
74
                }
×
75

76
                public bool ContainsKeyName(string name)
NEW
77
                {
×
NEW
78
                        return this._data.Keys.Select(k => k.Name).Contains(name);
×
NEW
79
                }
×
80

81
                /// <summary>
82
                /// Clear all Dictionary entries.
83
                /// </summary>
84
                public void Clear()
85
                {
7,977✔
86
                        this._data.Clear();
7,977✔
87
                }
7,977✔
88
        }
89
}
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