You can't access foo and Rhino.Mocks won't help you since it needs to
be in control of creating the CustomerClass2 if you want it to
track/stub virtual method calls. Since you have the creation
hard-coded, there's no easy way to test the code as it is currently
written.
One alternative might be to create a factory to control creation of
CustomClass2. During production, the factory would just do as you
currently do -- new up a new CustomClass2. During testing, you could
provide a mock factory which, in turn, could be set up to return a
mock CustomClass2. If "Start" is a virtual method on CustomClass2,
then Rhino.Mocks can intercept and track if it was called.
---
Patrick Steele
http://weblogs.asp.net/psteele
> --
> You received this message because you are subscribed to the Google Groups
> "Rhino.Mocks" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/rhinomocks/-/vlc9lvATtyoJ.
> To post to this group, send email to
rhino...@googlegroups.com.
> To unsubscribe from this group, send email to
>
rhinomocks+...@googlegroups.com.
> For more options, visit this group at
>
http://groups.google.com/group/rhinomocks?hl=en.