public class ClassA { private ClassB mock = NSubstitute.Substitute.ForPartsOf<ClassB>();
public ClassB PropertyA { get { return mock; } } }
public class ClassB { public virtual string PropertyB { get { throw new System.Exception("ERROR"); } set { throw new System.Exception("ERROR"); } } }
ClasseA mock = NSubstitute.Substitute.ForPartsOf<ClasseA>();
mock.PropertyA.PropertyB.Returns("My own return");
--
You received this message because you are subscribed to the Google Groups "NSubstitute" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nsubstitute...@googlegroups.com.
To post to this group, send email to nsubs...@googlegroups.com.
Visit this group at https://groups.google.com/group/nsubstitute.
For more options, visit https://groups.google.com/d/optout.