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
I seem to remember you could just pass in a regular old value and it would be satisfied
It.Is(1)
rather than
It.Is<int>(x => 1 == x ) // ERRY GOTDAMN TIME
Seems like it's trivial to implement, like this replacement
public static class Is
{
public static TValue Exactly<TValue>(TValue value)
{
return Match<TValue>.Create<TValue>(v => EqualityComparer<TValue>.Default.Equals(value, v));
}
}
So why not? Is there some corner case or issue when processing this Match down the road? I can understand that there are assumptions about what is considered equality, but if we know what the deal is going in, why do we have to bash ourselves over the head with the Expression route?
The text was updated successfully, but these errors were encountered:
@stakx Forgot about this stinker right here. Of course that's the exact way it's done. At the time I wrote this I was trying to remember how I had previously been able to pass in a constant value. Was just looking in the wrong place. I'll clean up my mess, thanks.
I seem to remember you could just pass in a regular old value and it would be satisfied
rather than
Seems like it's trivial to implement, like this replacement
So why not? Is there some corner case or issue when processing this Match down the road? I can understand that there are assumptions about what is considered equality, but if we know what the deal is going in, why do we have to bash ourselves over the head with the Expression route?
The text was updated successfully, but these errors were encountered: