Skip to content

Commit fc4781c

Browse files
(#177) Fix test when logging package behaves differently between .net versions
1 parent 9ca765f commit fc4781c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Stravaig.Configuration.Diagnostics.Tests/RegressionTests/LoggingEmptyKeyConfigTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ public void TwoEmptyKeys()
4747
var nullProperties = properties
4848
.Where(p => p.Key is not ("_EmptyTopLevel" or "A_Regular_Key" or "{OriginalFormat}"))
4949
.ToArray();
50+
51+
#if NET6_0_OR_GREATER
52+
foreach(var nullProperty in nullProperties)
53+
nullProperty.Value.ShouldBeNull($"Property \"{nullProperty.Key}\" should have a null value.");
54+
#else
5055
foreach(var nullProperty in nullProperties)
5156
nullProperty.Value.ShouldBe("(null)", $"Property \"{nullProperty.Key}\" should have a dummy null value.");
57+
#endif
5258
}
5359
}

0 commit comments

Comments
 (0)