You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ignoring the opinion we shouldn't verify loggers...we do... ILogger<X> implements ILogger and IMock<ILogger<X>> can be cast to IMock<ILogger> since T is covariant in IMock<T> but the helper extension methods we have for IMock<ILogger> use Verify methods...which are not on IMock<T> just Mock<T>.
As such we've had to dupe all our helper methods one set for Mock<ILogger> and a 2nd for Mock<ILogger<T>> which i mean...who cares but wondering if we can go a little DRYer in the implementation.
So wondering if there's a reason the Verify methods aren't on IMock<T>
initial glance all the Verify signatures look ok for IMock, but since this wasn't done i'm guessing there was a reason...but i didn't stumble upon it with an hour of searching so either i suck at searching or it's not mentioned as to why it was skipped or i'm really the first to consider it (most unlikely).
If it's about other implementations of IMock not wanted to support verify would u consider an IVerifiableMock<T> in the hierarchy, or would that be too much to maintain. totally get that.
looking forward to insights, thanks!
The text was updated successfully, but these errors were encountered:
ignoring the opinion we shouldn't verify loggers...we do...
ILogger<X>
implementsILogger
andIMock<ILogger<X>>
can be cast toIMock<ILogger>
since T is covariant inIMock<T>
but the helper extension methods we have forIMock<ILogger>
use Verify methods...which are not onIMock<T>
justMock<T>
.As such we've had to dupe all our helper methods one set for
Mock<ILogger>
and a 2nd forMock<ILogger<T>>
which i mean...who cares but wondering if we can go a little DRYer in the implementation.So wondering if there's a reason the Verify methods aren't on
IMock<T>
initial glance all the Verify signatures look ok for IMock, but since this wasn't done i'm guessing there was a reason...but i didn't stumble upon it with an hour of searching so either i suck at searching or it's not mentioned as to why it was skipped or i'm really the first to consider it (most unlikely).
If it's about other implementations of IMock not wanted to support verify would u consider an
IVerifiableMock<T>
in the hierarchy, or would that be too much to maintain. totally get that.looking forward to insights, thanks!
The text was updated successfully, but these errors were encountered: