< Summary

Information
Class: UIBlazor.Services.Settings.CommonSettingsProvider
Assembly: UIBlazor
File(s): /home/runner/work/InvAit/InvAit/UIBlazor/Services/Settings/CommonSettingsProvider.cs
Tag: 14_22728831704
Line coverage
0%
Covered lines: 0
Uncovered lines: 7
Coverable lines: 7
Total lines: 26
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
AfterInitAsync()0%620%
ResetAsync()100%210%

File(s)

/home/runner/work/InvAit/InvAit/UIBlazor/Services/Settings/CommonSettingsProvider.cs

#LineLine coverage
 1using System.Globalization;
 2
 3namespace UIBlazor.Services.Settings;
 4
 5public class CommonSettingsProvider(
 6    ILocalStorageService storage,
 7    ILogger<CommonSettingsProvider> logger)
 08    : BaseSettingsProvider<CommonOptions>(storage, logger, "CommonSettings"), ICommonSettingsProvider
 9{
 10    protected override Task AfterInitAsync()
 11    {
 012        if (Current.Culture.Length != 5)
 13        {
 14            // Превратит "en" в "en-US", "ru" в "ru-RU" на основе системных данных
 015            Current.Culture = CultureInfo.CreateSpecificCulture(Current.Culture).Name;
 16        }
 17
 018        return Task.CompletedTask;
 19    }
 20
 21    public override async Task ResetAsync()
 22    {
 023        Current.ToolTimeoutMs = 30_000;
 024        await SaveAsync();
 025    }
 26}