locked
MoleBehaviors.AttachTo methods behavior RRS feed

  • Question

  • Hi!

    // 1. This instruction attaches NotImplemented behavior to the entire assembly.

     Microsoft.Moles.Framework.MoleBehaviors.AttachToAssembly(Assembly.GetAssembly(typeof(A)),
                    Microsoft.Moles.Framework.MoleBehaviors.NotImplemented);

    // 2. Following instruction doesn't override behavior of type A.
     Microsoft.Moles.Framework.MoleBehaviors.AttachToType(typeof(A),
                   Microsoft.Moles.Framework.MoleBehaviors.Fallthrough);

    Is it expected behavior?

    Thanks!

    Wednesday, December 15, 2010 8:38 AM

Answers

  • You should reverse the calls since the first behavior wins.
    Jonathan "Peli" de Halleux - Try Pex online at www.pexforfun.com!
    • Marked as answer by Alec A Thursday, January 6, 2011 8:34 AM
    Wednesday, January 5, 2011 4:34 AM