< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.ChannelBindingMessagePropertyHelper
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/Common/src/CoreWCF/Channels/ChannelBindingMessagePropertyHelper.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 19
Coverable lines: 19
Total lines: 58
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 10
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
TryGet(...)0%220%
TryGet(...)0%440%
AddTo(...)0%220%
AddTo(...)0%220%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/Common/src/CoreWCF/Channels/ChannelBindingMessagePropertyHelper.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.Channels
 5{
 6    internal static class ChannelBindingMessagePropertyHelper
 7    {
 8        internal static bool TryGet(Message message, out ChannelBindingMessageProperty property)
 9        {
 010            if (message == null)
 11            {
 012                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(message));
 13            }
 14
 015            return TryGet(message.Properties, out property);
 16        }
 17
 18        internal static bool TryGet(MessageProperties properties, out ChannelBindingMessageProperty property)
 19        {
 020            if (properties == null)
 21            {
 022                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(properties));
 23            }
 24
 025            property = null;
 26
 027            if (properties.TryGetValue(ChannelBindingMessageProperty.Name, out object value))
 28            {
 029                property = value as ChannelBindingMessageProperty;
 030                return property != null;
 31            }
 32
 033            return false;
 34        }
 35
 36        internal static void AddTo(this ChannelBindingMessageProperty channelBindingProperty, Message message)
 37        {
 038            if (message == null)
 39            {
 040                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(message));
 41            }
 42
 043            channelBindingProperty.AddTo(message.Properties);
 044        }
 45
 46        internal static void AddTo(this ChannelBindingMessageProperty channelBindingProperty, MessageProperties properti
 47        {
 48            // Throws if disposed
 049            System.Security.Authentication.ExtendedProtection.ChannelBinding dummy = channelBindingProperty.ChannelBindi
 050            if (properties == null)
 51            {
 052                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(properties));
 53            }
 54
 055            properties.Add(ChannelBindingMessageProperty.Name, channelBindingProperty);
 056        }
 57    }
 58}