Skip to content

Commit

Permalink
Update examples in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sandermvanvliet committed Oct 15, 2018
1 parent 4e5e49d commit ba8d943
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,16 @@ public class WhenExecutingBusinessLogic
{
public void GivenInputOfFiveCharacters_MessageIsLogged()
{
var inMemorySink = new Serilog.Sinks.InMemory.InMemorySink();

var logger = new LoggerConfiguration()
.WriteTo.Sink(inMemorySink)
.WriteTo.InMemory()
.CreateLogger();

var logic = new ComplicatedBusinessLogic(logger);

logic.FirstTenCharacters("12345");

logger
// Use the static Instance property to access the in-memory sink
InMemorySink.Instance
.Should()
.HaveMessage("Input is {count} characters long");
}
Expand Down Expand Up @@ -100,7 +99,7 @@ public void GivenInputOfFiveCharacters_MessageIsLoggedOnce()
{
/* omitted for brevity */

logger
InMemorySink.Instance
.Should()
.HaveMessage("Input is {count} characters long")
.Appearing().Once();
Expand All @@ -116,7 +115,7 @@ public void GivenInputOfFiveCharacters_CountPropertyValueIsFive()
{
/* omitted for brevity */

logger
InMemorySink.Instance
.Should()
.HaveMessage("Input is {count} characters long")
.Appearing().Once();
Expand All @@ -134,7 +133,7 @@ public void GivenLoopWithFiveItems_MessageIsLoggedFiveTimes()
{
/* omitted for brevity */

logger
InMemorySink.Instance
.Should()
.HaveMessage("Input is {count} characters long")
.Appearing().Times(5);
Expand Down

0 comments on commit ba8d943

Please sign in to comment.