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

DomCR / ACadSharp / 10546434957

25 Aug 2024 11:09AM UTC coverage: 75.832% (-0.2%) from 75.987%
10546434957

push

github

web-flow
Merge pull request #428 from DomCR/UnknownNonGraphicalObject

Unknown None Graphical Object

4853 of 7047 branches covered (68.87%)

Branch coverage included in aggregate %.

54 of 62 new or added lines in 11 files covered. (87.1%)

69 existing lines in 25 files now uncovered.

19285 of 24784 relevant lines covered (77.81%)

33698.64 hits per line

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

66.67
/src/ACadSharp/Objects/SortEntitiesTable.cs
1
using ACadSharp.Attributes;
2
using ACadSharp.Entities;
3
using ACadSharp.Tables;
4
using System;
5
using System.Collections.Generic;
6

7
namespace ACadSharp.Objects
8
{
9
        /// <summary>
10
        /// Represents a <see cref="SortEntitiesTable"/> object
11
        /// </summary>
12
        /// <remarks>
13
        /// Object name <see cref="DxfFileToken.ObjectSortEntsTable"/> <br/>
14
        /// Dxf class name <see cref="DxfSubclassMarker.SortentsTable"/>
15
        /// </remarks>
16
        [DxfName(DxfFileToken.ObjectSortEntsTable)]
17
        [DxfSubClass(DxfSubclassMarker.SortentsTable)]
18
        public partial class SortEntitiesTable : NonGraphicalObject
19
        {
20
                /// <summary>
21
                /// Dictionary entry name for the object <see cref="SortEntitiesTable"/>
22
                /// </summary>
23
                public const string DictionaryEntryName = "ACAD_SORTENTS";
24

25
                /// <inheritdoc/>
UNCOV
26
                public override ObjectType ObjectType => ObjectType.UNLISTED;
×
27

28
                /// <inheritdoc/>
29
                public override string ObjectName => DxfFileToken.ObjectSortEntsTable;
24✔
30

31
                /// <inheritdoc/>
UNCOV
32
                public override string SubclassMarker => DxfSubclassMarker.SortentsTable;
×
33

34
                /// <summary>
35
                /// Block owner where the table is applied
36
                /// </summary>
37
                [DxfCodeValue(330)]
38
                public BlockRecord BlockOwner { get; internal set; }
1,685✔
39

40
                /// <summary>
41
                /// List of the <see cref="BlockOwner"/> entities sorted.
42
                /// </summary>
43
                public IEnumerable<Sorter> Sorters { get { return this._sorters; } }
78✔
44

45
                private List<Sorter> _sorters = new();
333✔
46

47
                internal SortEntitiesTable()
333✔
48
                {
333✔
49
                        this.Name = DictionaryEntryName;
333✔
50
                }
333✔
51

52
                internal SortEntitiesTable(BlockRecord owner) : this()
1✔
53
                {
1✔
54
                        this.BlockOwner = owner;
1✔
55
                }
1✔
56

57
                /// <summary>
58
                /// Sorter attached to an entity.
59
                /// </summary>
60
                /// <param name="entity">Enity in the block to be sorted.</param>
61
                /// <param name="sorterHandle">Sorter handle, will use the entity handle if null.</param>
62
                /// <exception cref="ArgumentException"></exception>
63
                public void AddEntity(Entity entity, ulong? sorterHandle = null)
64
                {
1,328✔
65
                        if (entity.Owner != null && entity.Owner != this.BlockOwner)
1,328!
66
                        {
×
67
                                throw new ArgumentException($"Entity is not owned by the block {this.BlockOwner.Name}", nameof(entity));
×
68
                        }
69

70
                        this._sorters.Add(new Sorter(entity, sorterHandle));
1,328✔
71
                }
1,328✔
72

73
                internal void OnAddEntity(object sender, CollectionChangedEventArgs e)
74
                {
×
75
                        this._sorters.Add(new Sorter((Entity)e.Item));
×
76
                }
×
77
        }
78
}
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