When using a mocking framework and MSPEC where do you set your stubs
        Posted  
        
            by Kev Hunter
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Kev Hunter
        
        
        
        Published on 2010-03-29T19:26:37Z
        Indexed on 
            2010/03/29
            20:43 UTC
        
        
        Read the original article
        Hit count: 567
        
I am relatively new to using MSpec and as I write more and more tests it becomes obvious to reduce duplication you often have to use a base class for your setup as per Rob Conery's article
I am happy with using the AssertWasCalled method to verify my expectations, but where do you set up a stub's return value, I find it useful to set the context in the base class injecting my dependencies but that (I think) means that I need to set my stubs up in the Because delegate which just feels wrong.
Is there a better approach I am missing?
© Stack Overflow or respective owner