-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Conversation
@@ -72,6 +72,9 @@ public override Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterCo | |||
return InputFormatterResult.FailureAsync(); | |||
} | |||
|
|||
var loggerFactory = context.HttpContext.RequestServices.GetRequiredService<ILoggerFactory>(); | |||
var logger = loggerFactory.CreateLogger<FileResult>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be passing this in the constructor.
2450bae
to
9f4c671
Compare
It.IsAny<object>(), | ||
It.IsAny<Exception>(), | ||
It.IsAny<Func<object, Exception, string>>()), | ||
Times.Once); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This formatting hurts my eyes. What is this testing, anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That when we have an error coming out of the formatter we log the error in addition to returning it. I suppose it's probably mostly paranoia on my to double check that the logging happened, I'll remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just fix the indentation then? The Times.Once
can't be on the same line as Mock.Get
.
Try something like:
Mock
.Get<ILogger>(logger)
.Verify(l => l.Log(
LogLevel.Verbose,
It.IsAny<int>(),
It.IsAny<object>(),
It.IsAny<Exception>(),
It.IsAny<Func<object, Exception, string>>()),
Times.Once);
ce5cb8a
to
10bde5c
Compare
🆙 📅 |
|
713ea13
to
96d4bed
Compare
96d4bed
to
91e837d
Compare
Fixes #3557.