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

DomCR / ACadSharp / 16146928965

08 Jul 2025 03:01PM UTC coverage: 75.057% (-0.04%) from 75.101%
16146928965

push

github

web-flow
Merge pull request #700 from DomCR/issue-696_sortentitiestable-dwg-fix

issue-696 sortentities fix

5851 of 8573 branches covered (68.25%)

Branch coverage included in aggregate %.

40 of 71 new or added lines in 6 files covered. (56.34%)

8 existing lines in 3 files now uncovered.

23265 of 30219 relevant lines covered (76.99%)

81591.98 hits per line

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

69.23
/src/ACadSharp/Objects/SortEntitiesTable.Sorter.cs
1
using ACadSharp.Attributes;
2
using ACadSharp.Entities;
3

4
namespace ACadSharp.Objects
5
{
6
        public partial class SortEntitiesTable
7
        {
8
                /// <summary>
9
                /// Entity sorter based in their position in the collection.
10
                /// </summary>
11
                public class Sorter : System.IComparable<Sorter>
12
                {
13
                        /// <summary>
14
                        /// Sorter handle, if this doesn't point to an entity, the value will match with <see cref="Entity"/>'s handle.
15
                        /// </summary>
16
                        [DxfCodeValue(5)]
17
                        public ulong SortHandle { get; set; }
3,608✔
18

19
                        /// <summary>
20
                        /// Entity to set the order to.
21
                        /// </summary>
22
                        [DxfCodeValue(331)]
23
                        public Entity Entity { get; set; }
2,979✔
24

25
                        /// <summary>
26
                        /// Sorter constructor with the entity and handle.
27
                        /// </summary>
28
                        /// <param name="entity">Entity in the block to be sorted.</param>
29
                        /// <param name="handle">Sorter handle.</param>
30
                        public Sorter(Entity entity, ulong handle)
2,817✔
31
                        {
2,817✔
32
                                this.Entity = entity;
2,817✔
33
                                this.SortHandle = handle;
2,817✔
34
                        }
2,817✔
35

36
                        /// <inheritdoc/>
37
                        public override string ToString()
NEW
38
                        {
×
NEW
39
                                return $"{this.SortHandle} | {this.Entity?.ToString()}";
×
NEW
40
                        }
×
41

42
                        /// <inheritdoc/>
43
                        public int CompareTo(Sorter other)
44
                        {
208✔
45
                                if (this.SortHandle < other.SortHandle)
208✔
46
                                {
99✔
47
                                        return -1;
99✔
48
                                }
49
                                else if (this.SortHandle > other.SortHandle)
109!
50
                                {
109✔
51
                                        return 1;
109✔
52
                                }
53
                                else
NEW
54
                                {
×
NEW
55
                                        return 0;
×
56
                                }
57
                        }
208✔
58
                }
59
        }
60
}
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