< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Configuration.ServiceModelWebServiceCollectionExtensions
Assembly: CoreWCF.WebHttp
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.WebHttp/src/CoreWCF/Configuration/ServiceModelWebServiceCollectionExtensions.cs
Line coverage
88%
Covered lines: 8
Uncovered lines: 1
Coverable lines: 9
Total lines: 35
Line coverage: 88.8%
Branch coverage
75%
Covered branches: 3
Total branches: 4
Branch coverage: 75%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
AddServiceModelWebServices(...)75%4488.88%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.WebHttp/src/CoreWCF/Configuration/ServiceModelWebServiceCollectionExtensions.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.Linq;
 6using CoreWCF.Description;
 7using CoreWCF.OpenApi;
 8using Microsoft.Extensions.DependencyInjection;
 9using Swashbuckle.AspNetCore.Swagger;
 10
 11namespace CoreWCF.Configuration
 12{
 13    public static class ServiceModelWebServiceCollectionExtensions
 14    {
 15        public static IServiceCollection AddServiceModelWebServices(this IServiceCollection services, Action<OpenApiOpti
 16        {
 450617            bool alreadyAdded = services.Any(s => s.ServiceType == typeof(IServiceBuilder));
 3618            if (!alreadyAdded)
 19            {
 3620                services.AddServiceModelServices();
 21            }
 22
 3623            services.AddSingleton<IServiceBehavior, WebHttpServiceBehavior>();
 3624            services.AddSingleton<OpenApiDocumentProvider>();
 3625            services.AddSingleton<ISwaggerProvider>(provider => provider.GetRequiredService<OpenApiDocumentProvider>());
 26
 3627            if (configure != null)
 28            {
 029                services.Configure<OpenApiOptions>(o => configure(o));
 30            }
 31
 3632            return services;
 33        }
 34    }
 35}