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

DomCR / ACadSharp / 12619114630

05 Jan 2025 11:27AM UTC coverage: 75.645% (+0.6%) from 75.001%
12619114630

Pull #490

github

web-flow
Merge 01b5ca4aa into 0d0db0394
Pull Request #490: Issue 474 header defaults

5217 of 7612 branches covered (68.54%)

Branch coverage included in aggregate %.

129 of 157 new or added lines in 5 files covered. (82.17%)

581 existing lines in 13 files now uncovered.

20882 of 26890 relevant lines covered (77.66%)

39172.96 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

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

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

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

27
                /// <inheritdoc/>
28
                public override string Name
29
                {
30
                        get { return base.Name; }
168✔
31
                        set
32
                        {
16✔
33
                                if (!value.Contains('$'))
16!
UNCOV
34
                                {
×
35
                                        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));
×
36
                                }
37

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

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

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

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

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

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