I'd like to call some code when a virtual property is set on the class I've substituted. Something like this:
var mySubstitute = Substitute.For<MyClass>();
// This line doesn't work, but was my best guess
mySubstitute.When(x => x.VirtualProperty).Do(x => DoSomething());
mySubstitute.VirtualProperty = aValue; // DoSomething should also get called
Can this be done, and if it can, how?
--
You received this message because you are subscribed to the Google Groups "NSubstitute" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nsubstitute/-/cQYxKBwaDuUJ.
To post to this group, send email to nsubs...@googlegroups.com.
To unsubscribe from this group, send email to nsubstitute...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nsubstitute?hl=en.