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

DomCR / ACadSharp / 17737836230

15 Sep 2025 03:12PM UTC coverage: 2.092% (-76.2%) from 78.245%
17737836230

push

github

web-flow
Merge pull request #790 from DomCR/addflag-refactor

addflag refactor

141 of 9225 branches covered (1.53%)

Branch coverage included in aggregate %.

0 of 93 new or added lines in 10 files covered. (0.0%)

24910 existing lines in 372 files now uncovered.

724 of 32119 relevant lines covered (2.25%)

5.76 hits per line

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

0.0
/src/ACadSharp/XData/ExtendedData.cs
1
using ACadSharp.Tables;
2
using System.Collections.Generic;
3
using System.Linq;
4

5
namespace ACadSharp.XData
6
{
7
        /// <summary>
8
        /// Extended data linked to an <see cref="AppId"/>.
9
        /// </summary>
10
        public class ExtendedData
11
        {
12
                /// <summary>
13
                /// Records contained in this Extended Data instance.
14
                /// </summary>
UNCOV
15
                public List<ExtendedDataRecord> Records { get; } = new();   //Should be private?
×
16

17
                /// <summary>
18
                /// Default constructor.
19
                /// </summary>
UNCOV
20
                public ExtendedData()
×
UNCOV
21
                {
×
UNCOV
22
                }
×
23

24
                /// <summary>
25
                /// Initialize an instance of <see cref="ExtendedData"/> with a collection of records.
26
                /// </summary>
27
                /// <param name="records">Records to add to the <see cref="ExtendedData"/>.</param>
UNCOV
28
                public ExtendedData(IEnumerable<ExtendedDataRecord> records) : this()
×
UNCOV
29
                {
×
UNCOV
30
                        this.Records.AddRange(records);
×
UNCOV
31
                }
×
32

33
                /// <summary>
34
                /// Make sure that the first and last record are <see cref="ExtendedDataControlString"/>.
35
                /// </summary>
36
                /// <remarks>
37
                /// The first control string must be the opening one and the last one closing.
38
                /// </remarks>
39
                public void AddControlStrings()
UNCOV
40
                {
×
UNCOV
41
                        if (!this.Records.Any())
×
UNCOV
42
                        {
×
UNCOV
43
                                this.Records.Add(ExtendedDataControlString.Open);
×
UNCOV
44
                                this.Records.Add(ExtendedDataControlString.Close);
×
UNCOV
45
                                return;
×
46
                        }
47

UNCOV
48
                        var first = this.Records.First();
×
UNCOV
49
                        if (first is not ExtendedDataControlString firstControl)
×
UNCOV
50
                        {
×
UNCOV
51
                                this.Records.Insert(0, ExtendedDataControlString.Open);
×
UNCOV
52
                        }
×
53
                        else if (firstControl.IsClosing)
×
54
                        {
×
55
                                this.Records.Insert(0, ExtendedDataControlString.Open);
×
56
                        }
×
57

UNCOV
58
                        var last = this.Records.Last();
×
UNCOV
59
                        if (last is not ExtendedDataControlString lastControl)
×
UNCOV
60
                        {
×
UNCOV
61
                                this.Records.Add(ExtendedDataControlString.Close);
×
UNCOV
62
                        }
×
63
                        else if (!lastControl.IsClosing)
×
64
                        {
×
65
                                this.Records.Add(ExtendedDataControlString.Close);
×
66
                        }
×
UNCOV
67
                }
×
68
        }
69
}
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