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

DomCR / ACadSharp / 15942368495

28 Jun 2025 08:38AM UTC coverage: 75.336% (+0.007%) from 75.329%
15942368495

Pull #700

github

web-flow
Merge 063a8f436 into d7e4a6e08
Pull Request #700: issue-696 sortentities fix

5833 of 8541 branches covered (68.29%)

Branch coverage included in aggregate %.

18 of 28 new or added lines in 5 files covered. (64.29%)

4 existing lines in 2 files now uncovered.

23240 of 30050 relevant lines covered (77.34%)

82044.77 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,561✔
18

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