< Summary

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

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/5aaaab311aa14541478b9e402357d98b657a23e4/src/MyNet.Geography.Localization/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 MyNet.Geography.Localization.Providers;
 9using MyNet.Humanizer;
 10
 11#pragma warning disable IDE0130 // Namespace does not match folder structure
 12namespace MyNet.Geography;
 13#pragma warning restore IDE0130 // Namespace does not match folder structure
 14
 15public static class ServiceCollectionExtensions
 16{
 17    /// <summary>
 18    /// Adds the embedded country flag provider to the service collection, allowing retrieval of country flags from embe
 19    /// </summary>
 20    /// <param name="services">The service collection to which the provider will be added.</param>
 21    /// <returns>The updated service collection.</returns>
 22    public static IServiceCollection AddGeographyLocalization(this IServiceCollection services)
 23    {
 924        services.AddDisplayTextStrategy<Country, CountryDisplayTextStrategy>();
 25
 926        return services;
 27    }
 28}
 29