Simplify long description printing, add test

This commit is contained in:
Matt Nadareski
2025-10-05 11:14:36 -04:00
parent 0748468a8f
commit 69d263ca2a
2 changed files with 42 additions and 44 deletions

View File

@@ -1,4 +1,5 @@
using Xunit;
using System.Net.NetworkInformation;
using Xunit;
namespace SabreTools.CommandLine.Test
{
@@ -90,6 +91,26 @@ namespace SabreTools.CommandLine.Test
Assert.Empty(feature.Inputs);
}
[Fact]
public void FormatLongDescriptionTest()
{
var feature = new MockFeature("a", "a", "a", "Some long description that is normal");
var o = feature.FormatLongDescription(pre: 0);
Assert.Equal(2, o.Count);
feature = new MockFeature("a", "a", "a", "Some long description\nwith a newline");
o = feature.FormatLongDescription(pre: 0);
Assert.Equal(3, o.Count);
feature = new MockFeature("a", "a", "a", "Some long description\nwith\nmultiple\nnewlines");
o = feature.FormatLongDescription(pre: 0);
Assert.Equal(5, o.Count);
feature = new MockFeature("a", "a", "a", "Some long description\n - With formatting");
o = feature.FormatLongDescription(pre: 0);
Assert.Equal(3, o.Count);
}
/// <summary>
/// Mock Feature implementation for testing
/// </summary>