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

DomCR / ACadSharp / 10450722481

19 Aug 2024 09:22AM UTC coverage: 75.984% (+0.02%) from 75.966%
10450722481

push

github

web-flow
Merge pull request #427 from DomCR/issue-417_Hatch-polyline

Issue 417 hatch polyline

4831 of 7017 branches covered (68.85%)

Branch coverage included in aggregate %.

32 of 36 new or added lines in 1 file covered. (88.89%)

10 existing lines in 2 files now uncovered.

19243 of 24666 relevant lines covered (78.01%)

33126.82 hits per line

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

88.68
/src/ACadSharp/Entities/Hatch.BoundaryPath.cs
1
using ACadSharp.Attributes;
2
using CSUtilities.Extensions;
3
using System.Collections.Generic;
4
using System.Collections.ObjectModel;
5
using System.Collections.Specialized;
6
using System.Linq;
7

8
namespace ACadSharp.Entities
9
{
10
        public partial class Hatch
11
        {
12
                public partial class BoundaryPath
13
                {
14
                        public bool IsPolyline { get { return this.Edges.OfType<Polyline>().Any(); } }
10,032✔
15

16
                        /// <summary>
17
                        /// Boundary path type flag
18
                        /// </summary>
19
                        [DxfCodeValue(92)]
20
                        public BoundaryPathFlags Flags
21
                        {
22
                                get
23
                                {
1,201✔
24
                                        if (this.IsPolyline)
1,201✔
25
                                        {
1✔
26
                                                this._flags = this._flags.AddFlag(BoundaryPathFlags.Polyline);
1✔
27
                                        }
1✔
28
                                        else
29
                                        {
1,200✔
30
                                                this._flags = this._flags.RemoveFlag(BoundaryPathFlags.Polyline);
1,200✔
31
                                        }
1,200✔
32

33
                                        return this._flags;
1,201✔
34
                                }
1,201✔
35
                                set
36
                                {
713✔
37
                                        this._flags = value;
713✔
38
                                }
713✔
39
                        }
40

41
                        /// <summary>
42
                        /// Number of edges in this boundary path
43
                        /// </summary>
44
                        /// <remarks>
45
                        /// only if boundary is not a polyline
46
                        /// </remarks>
47
                        [DxfCodeValue(DxfReferenceType.Count, 93)]
48
                        public ObservableCollection<Edge> Edges { get; } = new();
10,695✔
49

50
                        /// <summary>
51
                        /// Source boundary objects
52
                        /// </summary>
53
                        [DxfCodeValue(DxfReferenceType.Count, 97)]
54
                        public List<Entity> Entities { get; set; } = new List<Entity>();
1,635✔
55

56
                        private BoundaryPathFlags _flags;
57

58
                        public BoundaryPath()
715✔
59
                        {
715✔
60
                                Edges.CollectionChanged += this.onEdgesCollectionChanged;
715✔
61
                        }
715✔
62

63
                        public BoundaryPath Clone()
64
                        {
×
65
                                throw new System.NotImplementedException();
×
66
                        }
67

68
                        private void onEdgesCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
69
                        {
2,856✔
70
                                switch (e.Action)
2,856✔
71
                                {
72
                                        case System.Collections.Specialized.NotifyCollectionChangedAction.Add:
73
                                                onAdd(e);
2,856✔
74
                                                break;
2,854✔
75
                                        case System.Collections.Specialized.NotifyCollectionChangedAction.Remove:
NEW
76
                                                break;
×
77
                                        case System.Collections.Specialized.NotifyCollectionChangedAction.Replace:
NEW
78
                                                break;
×
79
                                        case System.Collections.Specialized.NotifyCollectionChangedAction.Move:
NEW
80
                                                break;
×
81
                                        case System.Collections.Specialized.NotifyCollectionChangedAction.Reset:
NEW
82
                                                break;
×
83
                                }
84
                        }
2,854✔
85

86
                        private void onAdd(NotifyCollectionChangedEventArgs e)
87
                        {
2,856✔
88
                                foreach (Edge edge in e.NewItems)
14,278✔
89
                                {
2,856✔
90
                                        if (this.Edges.Count > 1 && this.IsPolyline)
2,856✔
91
                                        {
2✔
92
                                                throw new System.InvalidOperationException();
2✔
93
                                        }
94
                                }
2,854✔
95
                        }
2,854✔
96
                }
97
        }
98
}
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