Search code examples
methodstestingmbunit

MBUnit - Calling the same method multiple times in a sequence?


Is there a way in MBUnit to have the same test called multiple times with different parameters in a sequence, as such:

Method1() Method2(param A) Method3() Method2(ParamB) Method4() Method2(ParamC)

etc? I've tried using the Order parameter but sadly I was too hopeful in that the Ordering would be considered class-wide rather than test-wide (1,2,3,4,5,6 as opposed to 1,2a,2b,2c,3,4).


Solution

  • Can you explain the reasons for needing this? This sounds like you have dependencies between your test methods, which in general isn't a good way to go about writing test code.

    If you need something to be called in a particular sequence then why not simply expose it as a single test method which calls certain submethods in the order of your choosing?