< Summary

Information
Class: MyNet.Globalization.Localization.Translation.Catalog.TranslationCatalog
Assembly: MyNet.Globalization
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Globalization/Localization/Translation/Catalog/TranslationCatalog.cs
Tag: 323_28699572109
Line coverage
66%
Covered lines: 2
Uncovered lines: 1
Coverable lines: 3
Total lines: 31
Line coverage: 66.6%
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
.ctor(...)100%11100%
get_Resources()100%11100%
TryGetResource(...)100%210%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Globalization/Localization/Translation/Catalog/TranslationCatalog.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="TranslationCatalog.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System.Collections.Frozen;
 8using System.Collections.Generic;
 9using System.Collections.Immutable;
 10using System.Resources;
 11
 12namespace MyNet.Globalization.Localization.Translation.Catalog;
 13
 14/// <summary>
 15/// Immutable implementation of <see cref="ITranslationCatalog"/>.
 16/// </summary>
 17/// <remarks>
 18/// Initializes a new instance of the <see cref="TranslationCatalog"/> class.
 19/// </remarks>
 20/// <param name="resources">The registered translation resources.</param>
 21internal sealed class TranslationCatalog(ImmutableDictionary<string, ResourceManager> resources) : ITranslationCatalog
 22{
 2523    private readonly FrozenDictionary<string, ResourceManager> _resources = resources.ToFrozenDictionary();
 24
 25    /// <inheritdoc />
 99626    public IReadOnlyDictionary<string, ResourceManager> Resources => _resources;
 27
 28    /// <inheritdoc />
 029    public bool TryGetResource(string resourceKey, out ResourceManager resourceManager) => _resources.TryGetValue(resour
 30}
 31