Translation is abstract that's why I thought I could mock "behavior" before I understood.
I need to create a class that inheritates Translation to achieve it. Thanks On 11 sep, 15:20, bill richards <[email protected]> wrote: > My Unit test on this would be ... > > var trans = new Translation() > Assert.That(trans.Enabled, Is.True); > > On Sep 11, 1: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 -~----------~----~----~----~------~----~------~--~---
