< Summary

Information
Class: Allyaria.Theming.BrandTypes.BrandFont
Assembly: Allyaria.Theming
File(s): /home/runner/work/allyaria/allyaria/src/Allyaria.Theming/BrandTypes/BrandFont.cs
Line coverage
100%
Covered lines: 17
Uncovered lines: 0
Coverable lines: 17
Total lines: 49
Line coverage: 100%
Branch coverage
100%
Covered branches: 6
Total branches: 6
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%66100%
get_Monospace()100%11100%
get_SansSerif()100%11100%
get_Serif()100%11100%

File(s)

/home/runner/work/allyaria/allyaria/src/Allyaria.Theming/BrandTypes/BrandFont.cs

#LineLine coverage
 1namespace Allyaria.Theming.BrandTypes;
 2
 3/// <summary>
 4/// Represents the font configuration for a brand, providing distinct font families for sans-serif, serif, and monospace
 5/// text rendering.
 6/// </summary>
 7public sealed record BrandFont
 8{
 9    /// <summary>
 10    /// Initializes a new instance of the <see cref="BrandFont" /> struct with optional sans-serif, serif, and monospace
 11    /// family names.
 12    /// </summary>
 13    /// <param name="sansSerif">
 14    /// The sans-serif font family name to use. Defaults to <see cref="StyleDefaults.SansSerifFont" /> if null or whites
 15    /// </param>
 16    /// <param name="serif">
 17    /// The serif font family name to use. Defaults to <see cref="StyleDefaults.SerifFont" /> if null or whitespace.
 18    /// </param>
 19    /// <param name="monospace">
 20    /// The monospace font family name to use. Defaults to <see cref="StyleDefaults.MonospaceFont" /> if null or whitesp
 21    /// </param>
 16122    public BrandFont(string? sansSerif = null, string? serif = null, string? monospace = null)
 23    {
 16124        var setMonospace = string.IsNullOrWhiteSpace(value: monospace)
 16125            ? StyleDefaults.MonospaceFont
 16126            : monospace.Trim();
 27
 16128        var setSansSerif = string.IsNullOrWhiteSpace(value: sansSerif)
 16129            ? StyleDefaults.SansSerifFont
 16130            : sansSerif.Trim();
 31
 16132        var setSerif = string.IsNullOrWhiteSpace(value: serif)
 16133            ? StyleDefaults.SerifFont
 16134            : serif.Trim();
 35
 16136        Monospace = setMonospace;
 16137        SansSerif = setSansSerif;
 16138        Serif = setSerif;
 16139    }
 40
 41    /// <summary>Gets the monospace font family name used for fixed-width text.</summary>
 642    public string Monospace { get; }
 43
 44    /// <summary>Gets the sans-serif font family name used for general text rendering.</summary>
 2745    public string SansSerif { get; }
 46
 47    /// <summary>Gets the serif font family name used for formal or decorative text rendering.</summary>
 648    public string Serif { get; }
 49}