Skip to content

Commit

Permalink
Nitpicks - whitespace, slightly more specific test description
Browse files Browse the repository at this point in the history
  • Loading branch information
nblumhardt committed Sep 9, 2020
1 parent 23cae3c commit 94d9e1a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/Serilog.Tests/Formatting/Json/JsonValueFormatterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ public void DecimalFormatsAsNumber()
JsonLiteralTypesAreFormatted(-123.0m, "-123.0");
}


[Fact]
public void TimeSpanFormatsAsString()
{
Expand All @@ -118,15 +117,15 @@ public void GuidFormatsAsString()
}

[Fact]
public void ObjectsAreFormattedViaToStringAsString()
public void ObjectsAreFormattedAsJsonStringViaToString()
{
JsonLiteralTypesAreFormatted(new Exception("This e a Exception"), "\"System.Exception: This e a Exception\"");
JsonLiteralTypesAreFormatted(new AChair(), "\"a chair\"");
JsonLiteralTypesAreFormatted(new ToStringReturnsNull(), "\"\"");
}

[Fact]
public void ObjectsWithBugReturnExceptionWhenUseFormattedViaToStringAsString()
public void ObjectsAreFormattedAsExceptionStringsInJsonWhenToStringThrows()
{
Assert.Throws<ArgumentNullException>(() => JsonLiteralTypesAreFormatted(new ToStringThrows(), "will Throws a error before comparing with this string"));
}
Expand Down Expand Up @@ -209,11 +208,13 @@ class AChair
public int[] Legs => null;
public override string ToString() => "a chair";
}

class ToStringReturnsNull
{
public string AProp => "";
public override string ToString() => null;
}

class ToStringThrows
{
public string AProp => "";
Expand Down

0 comments on commit 94d9e1a

Please sign in to comment.