Ayende, Thanks for you response. Another question: when creating a mock we can pass arguments to the constructor. I guess its only to create a mock that hasn't a constructor without parameters. Can I assert on the values I pass to constructor ? I think no...
On 11 sep, 14:56, Ayende Rahien <[email protected]> wrote: > 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- Masquer le texte des messages précédents - > > - Afficher le texte des messages précédents - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
