src/SSC/ParallelDisplayFormatter.cs

実行済み 23 · 未実行 0 · 対象外 40
Coverage source: 043e27b9e5febd713c747d2558802e450fad8edd

実行済みCoberturaのhit数が1以上の行です。
未実行カバレッジ対象ですがhit数が0の行です。
対象外Coberturaに実行対象として記録されていない行です。
行状態HitsSource
1 対象外 using System.Globalization;
2 対象外
3 対象外 namespace SSC;
4 対象外
5 対象外 internal readonly struct ParallelDisplaySlot
6 対象外 {
7 対象外 public ParallelDisplaySlot(object? value, ValueState state)
8 対象外 {
9 実行済み 18 Value = value;
10 実行済み 18 State = state;
11 実行済み 18 }
12 対象外
13 実行済み 18 public object? Value { get; }
14 対象外
15 実行済み 18 public ValueState State { get; }
16 対象外 }
17 対象外
18 対象外 internal static class ParallelDisplayFormatter
19 対象外 {
20 対象外 public static string FormatSlots(int count, Func<int, ParallelDisplaySlot> getSlot)
21 対象外 {
22 実行済み 9 ArgumentOutOfRangeException.ThrowIfNegative(count);
23 実行済み 9 ArgumentNullException.ThrowIfNull(getSlot);
24 対象外
25 実行済み 9 var slots = new string[count];
26 実行済み 54 for (var modelIndex = 0; modelIndex < count; modelIndex++)
27 対象外 {
28 実行済み 18 var slot = getSlot(modelIndex);
29 実行済み 18 slots[modelIndex] = FormatSlot(modelIndex, slot.Value, slot.State);
30 対象外 }
31 対象外
32 実行済み 9 return string.Join(", ", slots);
33 対象外 }
34 対象外
35 対象外 public static string FormatSlot(int modelIndex, object? value, ValueState state)
36 対象外 {
37 実行済み 48 ArgumentOutOfRangeException.ThrowIfNegative(modelIndex);
38 対象外
39 実行済み 48 return string.Create(
40 実行済み 48 CultureInfo.InvariantCulture,
41 実行済み 48 $"[{modelIndex}]={FormatValue(value, state)}({state})");
42 対象外 }
43 対象外
44 対象外 private static string FormatValue(object? value, ValueState state)
45 対象外 {
46 実行済み 48 if (state == ValueState.Missing)
47 対象外 {
48 実行済み 4 return "<missing>";
49 対象外 }
50 対象外
51 実行済み 44 if (value is null)
52 対象外 {
53 実行済み 8 return "null";
54 対象外 }
55 対象外
56 実行済み 36 if (value is string text)
57 対象外 {
58 実行済み 28 return string.Create(CultureInfo.InvariantCulture, $"\"{text}\"");
59 対象外 }
60 対象外
61 実行済み 8 return Convert.ToString(value, CultureInfo.InvariantCulture) ?? string.Empty;
62 対象外 }
63 対象外 }