< Summary

Information
Class: UIBlazor.Options.BaseOptions
Assembly: UIBlazor
File(s): /home/runner/work/InvAit/InvAit/UIBlazor/Options/BaseOptions.cs
Tag: 14_22728831704
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 24
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
SetIfChanged(...)100%22100%
RaisePropertyChanged(...)100%22100%

File(s)

/home/runner/work/InvAit/InvAit/UIBlazor/Options/BaseOptions.cs

#LineLine coverage
 1using System.ComponentModel;
 2using System.Runtime.CompilerServices;
 3
 4namespace UIBlazor.Options;
 5
 6public abstract class BaseOptions : INotifyPropertyChanged
 7{
 8    public event PropertyChangedEventHandler? PropertyChanged;
 9
 10    /// <summary>
 11    /// При изменении вызывается <see cref="Debouncer"/> в и сохраняет настройки через 750mc
 12    /// </summary>
 13    protected void SetIfChanged<T>(ref T storage, T value, [CallerMemberName] string prop = "")
 14    {
 11215        if (EqualityComparer<T>.Default.Equals(storage, value))
 3216            return;
 17
 8018        storage = value;
 8019        RaisePropertyChanged(prop);
 8020    }
 21
 22    private void RaisePropertyChanged([CallerMemberName] string propertyName = "")
 8023        => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
 24}