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
As reported in here nsubstitute/NSubstitute#499 (comment) NSubstitute.Analyzers fails to find non-virtual member calls when substituting for class but assigning it to interface e.g
This gets even more fun if we have a IUnitOfWorkCoreCqrs field that gets modified by multiple threads and is sometimes assigned instances of different types. 😂
There may be some simple cases we can identify (local variable, single assignment?), but my initial feeling is that it may not be worth the cost (finding a reliable implementation, plus the performance overhead). Happy to be proven wrong though! :)
As reported in here nsubstitute/NSubstitute#499 (comment) NSubstitute.Analyzers fails to find non-virtual member calls when substituting for class but assigning it to interface e.g
In order to correctly report non-virtual member calls, we have to find actual substitute assignment
or
based on the type infered from expression, we should be able to enhance
CanBeSetuped
method.Possible roslyn API to use
Possible problems
The text was updated successfully, but these errors were encountered: