You cannot intercept virtual methods calls in the ctor.
The reason for that is that this is happening because the proxy ctor runs
and set up things.

On Fri, Sep 11, 2009 at 3:04 PM, TJA <[email protected]> wrote:

>
> Hello,
>
> I have to test a class that has some logic in its default constructor.
>
> public abstract class Translation : ITranslation
> {
> public Translation()
> {
>        this.Language = new Language();
>        this.IsInitialTranslation = true;
>        this.Enabled = true;
> }
> ...
> ..
> .
> }
>
> if in my test i do the following
>
> translation = MockRepository.GenerateMock<Prod.Translation>();
> Assert.IsTrue(translation.Enabled);
>
>
> but the test fails because Enabled is always falls. Did I missed
> something ?
>
> Thanks for your help.
>
> TJA
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to