Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public class PersonControllerTests
public PersonControllerTests(ITestOutputHelper output)
var correlationId = Guid.NewGuid().ToString();
var logger = new LoggerConfiguration()
outputTemplate: "{Timestamp:u} [{Level}] ({CorrelationId}) {Message}{NewLine}{Exception}")
.CreateLogger().ForContext("CorrelationId", correlationId);
_loggerFactory = new LoggerFactory();
private readonly ILoggerFactory _loggerFactory;
public void Get_persons()
var controller = new PersonController(_loggerFactory);
var result = controller.Get();
Assert.Contains("value1", result);
Assert.Contains("value2", result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment