Open lostincomputer opened 3 years ago
This is a feature request.
Most of my code and probably everyone else's code only depends on ILogger<> such as this:
class MyController(ILogger<MyController> logger)
In order to test this code I need to do this:
var loggerFactory = TestLoggerFactory.Create(); new MyController(loggerFactory.CreateLogger<MyController>()); // Assert loggerFactory.Sink here
I think that I would be great if there is a shorthand for directly creating an ILogger since most code under test only depends on ILogger<>.
var logger = TestLogger.Create<MyController>(); new MyController(logger); // Assert logger.Sink here
This makes the test code shorter.
Edit: And thanks for making the library.
Hello, it is a valid point and I will have a look at it.
Thanks for the feedback.
This is a feature request.
Most of my code and probably everyone else's code only depends on ILogger<> such as this:
class MyController(ILogger<MyController> logger)
In order to test this code I need to do this:
I think that I would be great if there is a shorthand for directly creating an ILogger since most code under test only depends on ILogger<>.
This makes the test code shorter.
Edit: And thanks for making the library.