Skip to content

Commit d8aaff4

Browse files
committed
Better handle default config values in documentation test
1 parent dc76143 commit d8aaff4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/ZeroLog.Impl.Full/Configuration/ZeroLogConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public sealed class ZeroLogConfiguration
5757
/// This allows hooking <c>LogManager.Shutdown</c> calls to <c>AppDomain.CurrentDomain.ProcessExit</c> events as this event is otherwise blocked by a foreground thread.
5858
/// </para>
5959
/// <para>
60-
/// Default: false.
60+
/// Default: false
6161
/// </para>
6262
/// </remarks>
6363
public bool UseBackgroundThread { get; init; } = false;

src/ZeroLog.Tests/DocumentationTests.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Collections.Generic;
22
using System.IO;
33
using System.Linq;
4+
using System.Text.RegularExpressions;
45
using System.Xml.Linq;
56
using NUnit.Framework;
67
using NUnit.Framework.Interfaces;
@@ -28,9 +29,11 @@ public void should_have_valid_documentation(XElement member)
2829
member.Elements("remarks").Count().ShouldBeLessThanOrEqualTo(1);
2930
}
3031

31-
foreach (var text in member.Elements().Select(i => i.Value.Trim()).Where(i => i.Length != 0))
32+
foreach (var elem in member.Elements())
3233
{
33-
if (!text.StartsWith("Default: "))
34+
var text = Regex.Replace(elem.Value, @"^\s*Default:.*", "", RegexOptions.Multiline).Trim();
35+
36+
if (text.Length != 0)
3437
text.ShouldEndWith(".");
3538
}
3639
}

0 commit comments

Comments
 (0)