I have a complex object that I'm trying to fake.
interface IContext
{
User User { get; }
}
A.CallTo(
() => _fakeContext.User.Subscription.Attributes)
.Returns(new List<Attribute>());
But I get the next exception:
The current proxy generator can not intercept the specified method for the following reasons: - Non virtual methods can not be intercepted
All nested types are properties, and they are simple anemic types with get; set;
property modifiers. And when I look into the debugger they all are fakes.
Is there any way to setup the last property of the chain and avoid setuping all previous ones?