< Summary

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

File(s)

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

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="CountryExtensions.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System.IO;
 8
 9#pragma warning disable IDE0130 // Namespace does not match folder structure
 10namespace MyNet.Geography.Resources;
 11#pragma warning restore IDE0130 // Namespace does not match folder structure
 12
 13public static class CountryExtensions
 14{
 015    private static readonly EmbeddedCountryFlagProvider DefaultFlagProvider = new();
 16
 17    extension(Country country)
 18    {
 19        /// <summary>
 20        /// Retrieves the flag of the specified country in the given size as a MemoryStream. The flag is obtained using 
 21        /// </summary>
 22        /// <param name="size">The size of the flag to retrieve.</param>
 23        /// <returns>A MemoryStream containing the flag image data.</returns>
 024        public MemoryStream GetFlag(FlagSize size) => country.GetFlag(DefaultFlagProvider, size);
 25    }
 26}
 27