< Summary

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

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="ResxDomainFakerProvider.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.Internet;
 13
 14/// <summary>
 15/// Provides fake domain datasets from localized RESX resources.
 16/// </summary>
 17public sealed class ResxDomainFakerProvider : ResxProviderBase, IDomainFakerProvider
 18{
 19    /// <summary>
 20    /// Creates a new instance of the <see cref="ResxDomainFakerProvider"/> 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="ResxDomainFakerProvider"/>.</returns>
 624    public static ResxDomainFakerProvider Create(CultureInfo culture) => new(culture);
 25
 26    /// <summary>
 27    /// Initializes a new instance of the <see cref="ResxDomainFakerProvider"/> 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 ResxDomainFakerProvider(CultureInfo culture)
 632        : base(culture, DomainsResources.ResourceManager)
 33    {
 334        Domains = LoadDataset(nameof(DomainsResources.Domains));
 335        Hosts = LoadDataset(nameof(DomainsResources.Hosts));
 336    }
 37
 38    /// <inheritdoc />
 39    public IReadOnlyList<string> Domains { get; }
 40
 41    /// <inheritdoc />
 42    public IReadOnlyList<string> Hosts { get; }
 43}
 44