< Summary

Information
Class: Spdx3.Model.ExpandedLicensing.Classes.WithAdditionOperator
Assembly: Spdx3
File(s): /home/runner/work/Spdx3/Spdx3/Spdx3/Model/ExpandedLicensing/Classes/WithAdditionOperator.cs
Line coverage
83%
Covered lines: 10
Uncovered lines: 2
Coverable lines: 12
Total lines: 42
Line coverage: 83.3%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_SubjectAddition()100%11100%
get_SubjectExtendableLicense()100%11100%
.ctor()100%210%
.ctor(...)100%11100%
Validate()100%11100%

File(s)

/home/runner/work/Spdx3/Spdx3/Spdx3/Model/ExpandedLicensing/Classes/WithAdditionOperator.cs

#LineLine coverage
 1using System.Diagnostics.CodeAnalysis;
 2using System.Text.Json.Serialization;
 3using Spdx3.Model.Core.Classes;
 4using Spdx3.Model.SimpleLicensing.Classes;
 5using Spdx3.Serialization;
 6using Spdx3.Utility;
 7
 8namespace Spdx3.Model.ExpandedLicensing.Classes;
 9
 10/// <summary>
 11/// Portion of an AnyLicenseInfo representing a License which has additional text applied to it.
 12/// See https://spdx.github.io/spdx-spec/v3.0.1/model/ExpandedLicensing/Classes/WithAdditionOperator/
 13/// </summary>
 14public class WithAdditionOperator : AnyLicenseInfo
 15{
 16    [JsonPropertyName("expandedlicensing_subjectAddition")]
 17    [JsonConverter(typeof(SpdxModelConverterFactory))]
 818    public required LicenseAddition SubjectAddition { get; set; }
 19
 20    [JsonPropertyName("expandedlicensing_subjectExtendableLicense")]
 21    [JsonConverter(typeof(SpdxModelConverterFactory))]
 822    public required ExtendableLicense SubjectExtendableLicense { get; set; }
 23
 024    protected internal WithAdditionOperator()
 25    {
 026    }
 27
 28    [SetsRequiredMembers]
 29    public WithAdditionOperator(Catalog catalog, CreationInfo creationInfo, ExtendableLicense subjectExtendableLicense,
 230        LicenseAddition subjectAddition) : base(catalog, creationInfo)
 31    {
 232        SubjectAddition = subjectAddition;
 233        SubjectExtendableLicense = subjectExtendableLicense;
 234    }
 35
 36    public override void Validate()
 37    {
 238        base.Validate();
 239        ValidateRequiredProperty(nameof(SubjectAddition));
 240        ValidateRequiredProperty(nameof(SubjectExtendableLicense));
 241    }
 42}