< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Configuration.WebHttpServiceBehavior
Assembly: CoreWCF.WebHttp
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.WebHttp/src/CoreWCF/Configuration/WebHttpServiceBehavior.cs
Line coverage
100%
Covered lines: 11
Uncovered lines: 0
Coverable lines: 11
Total lines: 42
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%11100%
AddBindingParameters(...)100%11100%
ApplyDispatchBehavior(...)100%11100%
Validate(...)100%44100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.WebHttp/src/CoreWCF/Configuration/WebHttpServiceBehavior.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
 4using System;
 5using System.Collections.ObjectModel;
 6using CoreWCF.Channels;
 7using CoreWCF.Collections.Generic;
 8using CoreWCF.Description;
 9
 10namespace CoreWCF.Configuration
 11{
 12    public class WebHttpServiceBehavior : IServiceBehavior
 13    {
 14        private readonly IServiceProvider _serviceProvider;
 15
 3616        public WebHttpServiceBehavior(IServiceProvider serviceProvider)
 17        {
 3618            _serviceProvider = serviceProvider;
 3619        }
 20
 21        public void AddBindingParameters(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase, Collect
 22        {
 3723        }
 24
 25        public void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
 26        {
 3627        }
 28
 29        public void Validate(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
 30        {
 14631            foreach (ServiceEndpoint endpoint in serviceDescription.Endpoints)
 32            {
 3733                WebMessageEncodingBindingElement webEncodingBindingElement = endpoint.Binding.CreateBindingElements().Fi
 3734                if (webEncodingBindingElement != null)
 35                {
 3736                    var behaviors = (KeyedByTypeCollection<IEndpointBehavior>)endpoint.EndpointBehaviors;
 3737                    behaviors.Add(new WebHttpBehavior(_serviceProvider));
 38                }
 39            }
 3640        }
 41    }
 42}