< Summary

Information
Class: MyNet.Geography.Resources.ServiceCollectionExtensions
Assembly: MyNet.Geography.Resources
File(s): https://raw.githubusercontent.com/sandre58/MyNet/5aaaab311aa14541478b9e402357d98b657a23e4/src/MyNet.Geography.Resources/Extensions/ServiceCollectionExtensions.cs
Tag: 342_31701152804
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 28
Line coverage: 100%
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
AddGeographyFlags(...)100%11100%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/5aaaab311aa14541478b9e402357d98b657a23e4/src/MyNet.Geography.Resources/Extensions/ServiceCollectionExtensions.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="ServiceCollectionExtensions.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using Microsoft.Extensions.DependencyInjection;
 8using Microsoft.Extensions.DependencyInjection.Extensions;
 9
 10#pragma warning disable IDE0130 // Namespace does not match folder structure
 11namespace MyNet.Geography.Resources;
 12#pragma warning restore IDE0130 // Namespace does not match folder structure
 13
 14public static class ServiceCollectionExtensions
 15{
 16    /// <summary>
 17    /// Adds the embedded country flag provider to the service collection, allowing retrieval of country flags from embe
 18    /// </summary>
 19    /// <param name="services">The service collection to which the provider will be added.</param>
 20    /// <returns>The updated service collection.</returns>
 21    public static IServiceCollection AddGeographyFlags(this IServiceCollection services)
 22    {
 1523        services.TryAddSingleton<ICountryFlagProvider, EmbeddedCountryFlagProvider>();
 24
 1525        return services;
 26    }
 27}
 28