< Summary

Information
Class: MyNet.Fakers.Contacts.ResxPhoneFakerProvider
Assembly: MyNet.Fakers
File(s): https://raw.githubusercontent.com/sandre58/MyNet/5aaaab311aa14541478b9e402357d98b657a23e4/src/MyNet.Fakers/Contacts/ResxPhoneFakerProvider.cs
Tag: 342_31701152804
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 48
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
Create(...)100%11100%
.ctor(...)100%11100%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/5aaaab311aa14541478b9e402357d98b657a23e4/src/MyNet.Fakers/Contacts/ResxPhoneFakerProvider.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="ResxPhoneFakerProvider.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System;
 8using System.Collections.Generic;
 9using System.Globalization;
 10using MyNet.Fakers.Localization;
 11
 12namespace MyNet.Fakers.Contacts;
 13
 14/// <summary>
 15/// Provides fake phone datasets from localized RESX resources.
 16/// </summary>
 17public sealed class ResxPhoneFakerProvider : ResxProviderBase, IPhoneFakerProvider
 18{
 19    /// <summary>
 20    /// Creates a new instance of the <see cref="ResxPhoneFakerProvider"/> class for the specified culture.
 21    /// </summary>
 22    /// <param name="culture">The culture associated with the provider.</param>
 23    /// <returns>A new instance of <see cref="ResxPhoneFakerProvider"/>.</returns>
 624    public static ResxPhoneFakerProvider Create(CultureInfo culture) => new(culture);
 25
 26    /// <summary>
 27    /// Initializes a new instance of the <see cref="ResxPhoneFakerProvider"/> class with the specified culture.
 28    /// </summary>
 29    /// <param name="culture">The culture associated with the provider.</param>
 30    /// <exception cref="ArgumentNullException">Thrown when the <paramref name="culture"/> is null.</exception>
 31    private ResxPhoneFakerProvider(CultureInfo culture)
 632        : base(culture, PatternsResources.ResourceManager)
 33    {
 334        NumberFormats = LoadDataset(nameof(PatternsResources.PhoneNumbers));
 335        MobileNumberFormats = LoadDataset(nameof(PatternsResources.PhoneMobileNumbers));
 336        InternationalNumberFormats = LoadDataset(nameof(PatternsResources.PhoneInternationalNumbers));
 337    }
 38
 39    /// <inheritdoc />
 40    public IReadOnlyList<string> NumberFormats { get; }
 41
 42    /// <inheritdoc />
 43    public IReadOnlyList<string> MobileNumberFormats { get; }
 44
 45    /// <inheritdoc />
 46    public IReadOnlyList<string> InternationalNumberFormats { get; }
 47}
 48