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

DomCR / ACadSharp / 25394487403

05 May 2026 06:23PM UTC coverage: 76.803% (-0.001%) from 76.804%
25394487403

Pull #1062

github

web-flow
Merge 7aa5d2673 into ab35acaf4
Pull Request #1062: issue-897 Refactor SortEntitiesTable

8556 of 12079 branches covered (70.83%)

Branch coverage included in aggregate %.

44 of 58 new or added lines in 3 files covered. (75.86%)

1 existing line in 1 file now uncovered.

30724 of 39065 relevant lines covered (78.65%)

153028.62 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,321✔
18

19
                        /// <summary>
20
                        /// Entity to set the order to.
21
                        /// </summary>
22
                        [DxfCodeValue(331)]
23
                        public Entity Entity { get; set; }
2,875✔
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,743✔
31
                        {
2,743✔
32
                                this.Entity = entity;
2,743✔
33
                                this.SortHandle = handle;
2,743✔
34
                        }
2,743✔
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
                        {
142✔
45
                                if (this.SortHandle < other.SortHandle)
142✔
46
                                {
56✔
47
                                        return -1;
56✔
48
                                }
49
                                else if (this.SortHandle > other.SortHandle)
86!
50
                                {
86✔
51
                                        return 1;
86✔
52
                                }
53
                                else
54
                                {
×
NEW
55
                                        return 0;
×
56
                                }
57
                        }
142✔
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