< Summary

Information
Class: MyNet.Humanizer.Formatting.Collections.ListFormattingOptionsPresets
Assembly: MyNet.Humanizer
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Humanizer/Formatting/Collections/ListFormattingOptionsPresets.cs
Tag: 323_28699572109
Line coverage
100%
Covered lines: 14
Uncovered lines: 0
Coverable lines: 14
Total lines: 36
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
.cctor()100%11100%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Humanizer/Formatting/Collections/ListFormattingOptionsPresets.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="ListFormattingOptionsPresets.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7namespace MyNet.Humanizer.Formatting.Collections;
 8
 9/// <summary>
 10/// Common presets for list formatting without changing global defaults.
 11/// </summary>
 12public static class ListFormattingOptionsPresets
 13{
 14    /// <summary>
 15    /// Gets comma-separated list without conjunction ("a, b, c").
 16    /// </summary>
 317    public static ListFormattingOptions CommaSeparated { get; } = new()
 318    {
 319        Separator = ", ",
 320        Conjunction = ListConjunction.None,
 321        TrimItems = true,
 322        IgnoreNullOrWhiteSpace = true
 323    };
 24
 25    /// <summary>
 26    /// Gets natural language list using conjunctions ("a, b and c").
 27    /// </summary>
 328    public static ListFormattingOptions NaturalLanguage { get; } = new()
 329    {
 330        Separator = ", ",
 331        Conjunction = ListConjunction.And,
 332        TrimItems = true,
 333        IgnoreNullOrWhiteSpace = true
 334    };
 35}
 36

Methods/Properties

.cctor()