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'm trying to mock a class in a library that uses concrete types for several of its properties, but I happen to know that the properties are only ever accessed via an interface that the concrete type implements.
This works fine:
Despite the fact that the mocked type defines "Property" as an object of type "ConcreteType" (presumably it would fail if there were code that relied on Property genuinely being of type "ConcreteType", but so far no such issues).
The issue is that one property is actually of type Task<ConcreteType>, and I want to replace it with mocked Task<IInterface>, and so far I haven't found any syntax that allows that.
If there were a SetupAsync( ) or similar function (matching ReturnsAsync()), I would think it might be possible?
The text was updated successfully, but these errors were encountered:
Due to lack of recent activity, this issue has been labeled as 'stale'.
It will be closed if no further activity occurs within 30 more days.
Any new comment will remove the label.
Category
Describe the feature
I'm trying to mock a class in a library that uses concrete types for several of its properties, but I happen to know that the properties are only ever accessed via an interface that the concrete type implements.
This works fine:
Despite the fact that the mocked type defines "Property" as an object of type "ConcreteType" (presumably it would fail if there were code that relied on Property genuinely being of type "ConcreteType", but so far no such issues).
The issue is that one property is actually of type
Task<ConcreteType>
, and I want to replace it with mockedTask<IInterface>
, and so far I haven't found any syntax that allows that.If there were a
SetupAsync( )
or similar function (matchingReturnsAsync()
), I would think it might be possible?The text was updated successfully, but these errors were encountered: