< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Description.MetadataConversionError
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Description/MetadataConversionError.cs
Line coverage
33%
Covered lines: 4
Uncovered lines: 8
Coverable lines: 12
Total lines: 33
Line coverage: 33.3%
Branch coverage
16%
Covered branches: 1
Total branches: 6
Branch coverage: 16.6%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%
.ctor(...)50%22100%
Equals(...)0%440%
GetHashCode()100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Description/MetadataConversionError.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4namespace CoreWCF.Description
 5{
 6    public class MetadataConversionError
 7    {
 08        public MetadataConversionError(string message) : this(message, false) { }
 9
 810        public MetadataConversionError(string message, bool isWarning)
 11        {
 812            Message = message ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(message));
 813            IsWarning = isWarning;
 814        }
 15
 016        public string Message { get; }
 017        public bool IsWarning { get; }
 18
 19        public override bool Equals(object obj)
 20        {
 021            MetadataConversionError otherError = obj as MetadataConversionError;
 022            if (otherError == null)
 023                return false;
 24
 025            return otherError.IsWarning == IsWarning && otherError.Message == Message;
 26        }
 27
 28        public override int GetHashCode()
 29        {
 030            return Message.GetHashCode();
 31        }
 32    }
 33}