|
From: Heiko H. <rdr...@gm...> - 2007-09-12 19:07:56
|
I know its a small issue and nothing ground breaking ;) Guess ill move my stubbing to the end of the testfixtures... The advantage I saw in stubbing inside a [Setup] is that you can remove the code thats not relevant for the test from the test. If I do it the other way around (stub after setting up my expectations), then many test will contain "useless" information, which I would have prefered to hide away so the linecount of testmethods keeps lower... Ok... I can refactor the expectations out and call the stubbing there... Like I said above... Its not a big issue... but I really would have liked a way to override a stub, once I have declared it. Guess its just my way of thinking here ;) -------- Original-Nachricht -------- > Datum: Wed, 12 Sep 2007 19:18:13 +0100 > Von: "Mike Capp" <mik...@gm...> > An: "NMock2 Development Discussion" <nmo...@li...> > Betreff: Re: [NMock2-Dev] Feature Request: "Stub" should have alower prioritythen "Expect" > I may be missing something, but I don't quite see why this is a big > deal. In your situation I'd do essentially the same thing Mike Mason > suggested - assign the mock in SetUp , do your Stubbing in a helper > method called at the start of each test that needs it, and Expect as > needed _before_ calling that helper. > > If it's really only a tiny minority of tests that need the special > behavior and you don't like the helper calls in every test, call the > helper from SetUp and reassign the mock before customizing it. > > - Mike > > On 12/09/2007, rdr...@ar... <rdr...@ar...> wrote: > > > > I would have to do a lot more "Copy&Paste" inheritance if i am unable to > override a speccific setup. For a simple view with 5 Events i would have > to create 5 different setup functions, which would all differe in one line. > And there is no way to refactor this out. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > NMock-two-dev mailing list > NMo...@li... > https://lists.sourceforge.net/lists/listinfo/nmock-two-dev -- Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten Browser-Versionen downloaden: http://www.gmx.net/de/go/browser |