Exclude some ToString() methods from coverage

These are only used for debug information and I'm okayish with them failing at runtime.
This commit is contained in:
Alexey Golub
2020-08-19 22:39:43 +03:00
parent 3831cfc7c0
commit c063251d89
7 changed files with 17 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
namespace CliFx.Domain
{
@@ -12,6 +13,7 @@ namespace CliFx.Domain
public CommandDirectiveInput(string name) => Name = name;
[ExcludeFromCodeCoverage]
public override string ToString() => $"[{Name}]";
}
}

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using CliFx.Internal.Extensions;
@@ -36,6 +37,7 @@ namespace CliFx.Domain
Options = options;
}
[ExcludeFromCodeCoverage]
public override string ToString()
{
var buffer = new StringBuilder();

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using CliFx.Internal.Extensions;
@@ -29,6 +30,7 @@ namespace CliFx.Domain
public string GetRawValues() => Values.Select(v => v.Quote()).JoinToString(" ");
[ExcludeFromCodeCoverage]
public override string ToString() => $"{GetRawAlias()} {GetRawValues()}";
}
}

View File

@@ -1,4 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Text;
@@ -75,6 +76,7 @@ namespace CliFx.Domain
public string GetInternalDisplayString() => $"{Property?.Name ?? "<implicit>"} ('{GetUserFacingDisplayString()}')";
[ExcludeFromCodeCoverage]
public override string ToString() => GetInternalDisplayString();
}

View File

@@ -1,4 +1,6 @@
namespace CliFx.Domain
using System.Diagnostics.CodeAnalysis;
namespace CliFx.Domain
{
internal class CommandParameterInput
{
@@ -6,6 +8,7 @@
public CommandParameterInput(string value) => Value = value;
[ExcludeFromCodeCoverage]
public override string ToString() => Value;
}
}

View File

@@ -1,4 +1,5 @@
using System.Reflection;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Text;
using CliFx.Attributes;
@@ -31,6 +32,7 @@ namespace CliFx.Domain
public string GetInternalDisplayString() => $"{Property?.Name ?? "<implicit>"} ([{Order}] {GetUserFacingDisplayString()})";
[ExcludeFromCodeCoverage]
public override string ToString() => GetInternalDisplayString();
}

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Reflection;
@@ -207,6 +208,7 @@ namespace CliFx.Domain
return buffer.ToString();
}
[ExcludeFromCodeCoverage]
public override string ToString() => GetInternalDisplayString();
}