Thanks for you help. It's clear now :)

On 11 sep, 14:57, Tomas <[email protected]> wrote:
> The Mock won't do what the class does, it just acts like the class.
>
> If you want to test whether Enabled is set in the constructor (that's
> a legitimate test-case) you create an actual Translation, and test
> that object's Enabled property.
>
> var translation = new Translation();
>
> Assert.IsTrue(translation.Enabled);
>
> Use mocks to "pretend" like you have objects that aren't really what
> you're testing.
>
> On Sep 11, 2: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
-~----------~----~----~----~------~----~------~--~---

Reply via email to