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

DomCR / ACadSharp / 12008475829

25 Nov 2024 10:52AM UTC coverage: 75.339% (-0.3%) from 75.668%
12008475829

push

github

web-flow
Merge pull request #494 from DomCR/Issue-487_DBCOLOR

Issue 487 dbcolor

4956 of 7275 branches covered (68.12%)

Branch coverage included in aggregate %.

116 of 206 new or added lines in 21 files covered. (56.31%)

91 existing lines in 11 files now uncovered.

19811 of 25599 relevant lines covered (77.39%)

36312.43 hits per line

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

52.63
/src/ACadSharp/Objects/BookColor.cs
1
using ACadSharp.Attributes;
2
using System;
3
using System.Linq;
4
using System.Xml.Linq;
5

6
namespace ACadSharp.Objects
7
{
8
        /// <summary>
9
        /// Represents a <see cref="BookColor"/> object.
10
        /// </summary>
11
        /// <remarks>
12
        /// Object name <see cref="DxfFileToken.ObjectDBColor"/> <br/>
13
        /// Dxf class name <see cref="DxfSubclassMarker.DbColor"/>
14
        /// </remarks>
15
        [DxfName(DxfFileToken.ObjectDBColor)]
16
        [DxfSubClass(DxfSubclassMarker.DbColor)]
17
        public class BookColor : NonGraphicalObject
18
        {
19
                /// <inheritdoc/>
NEW
20
                public override ObjectType ObjectType => ObjectType.UNLISTED;
×
21

22
                /// <inheritdoc/>
NEW
23
                public override string ObjectName => DxfFileToken.ObjectDBColor;
×
24

25
                /// <inheritdoc/>
NEW
26
                public override string SubclassMarker => DxfSubclassMarker.DbColor;
×
27

28
                /// <inheritdoc/>
29
                public override string Name
30
                {
31
                        get { return base.Name; }
168✔
32
                        set
33
                        {
16✔
34
                                if (!value.Contains('$'))
16!
NEW
35
                                {
×
NEW
36
                                        throw new ArgumentException($"Invalid BookColor name: ({value}), a book color name has to separate the book name and the color name by the character '$'", nameof(value));
×
37
                                }
38

39
                                base.Name = value;
16✔
40
                        }
16✔
41
                }
42

43
                /// <summary>
44
                /// Color name.
45
                /// </summary>
46
                public string ColorName { get { return this.Name.Split('$').Last(); } }
18✔
47

48
                /// <summary>
49
                /// Book name where the color is stored.
50
                /// </summary>
51
                public string BookName { get { return this.Name.Split('$').First(); } }
18✔
52

53
                [DxfCodeValue(62, 420)]
54
                public Color Color { get; set; }
22✔
55

56
                public BookColor() : base() { }
48✔
57

NEW
58
                public BookColor(string name) : base(name)
×
NEW
59
                {
×
NEW
60
                }
×
61
        }
62
}
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

© 2025 Coveralls, Inc