Skip to content

Commit

Permalink
Remove testes that have data that not happens in Serilog
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelsc committed Aug 5, 2020
1 parent 1a6f9b1 commit 23cae3c
Showing 1 changed file with 1 addition and 47 deletions.
48 changes: 1 addition & 47 deletions test/Serilog.Tests/Formatting/Json/JsonFormatterTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
using Serilog.Events;
using Serilog.Formatting.Json;
using Serilog.Parsing;
Expand Down Expand Up @@ -225,51 +225,5 @@ public void SequencesOfSequencesAreSerialized()
var h = (string)d.Properties.AProperty[0][0];
Assert.Equal("Hello", h);
}


[Fact]
public void ABadBehaviorClassAsSerialized()
{
var p = new MessageTemplateParser();
var e = new LogEvent(Some.OffsetInstant(), LogEventLevel.Information, null,
p.Parse("{@ABadBehavior}"), new[] { new LogEventProperty("ABadBehavior", new ScalarValue(new ToStringReturnsNull())) });

var d = FormatEvent(e);

var h = (string)d.Properties.ABadBehavior;
Assert.Empty(h);
}

[Fact]
public void ABadBehaviorClassAsStringification()
{
var p = new MessageTemplateParser();
var e = new LogEvent(Some.OffsetInstant(), LogEventLevel.Information, null,
p.Parse("{$ABadBehavior}"), new[] { new LogEventProperty("ABadBehavior", new ScalarValue(new ToStringReturnsNull())) });

var d = FormatEvent(e);

var h = (string)d.Properties.ABadBehavior;
Assert.Empty(h);
}

[Fact]
public void ABadBehaviorClassAsRenderings()
{
var p = new MessageTemplateParser();
var e = new LogEvent(Some.OffsetInstant(), LogEventLevel.Information, null,
p.Parse("{ABadBehavior}"), new[] { new LogEventProperty("ABadBehavior", new ScalarValue(new ToStringReturnsNull())) });

var d = FormatEvent(e);

var h = (string)d.Properties.ABadBehavior;
Assert.Empty(h);
}

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

0 comments on commit 23cae3c

Please sign in to comment.