Unit test to validate sequence of method calls
Posted: Fri Oct 02, 2009 1:04 pm
This is my understanding of what BDD would offer, in setting expectations, such as asserting that a sequence of methods are invoked in a certain order.
I have read that article by Fowler 'Mocks Aren't Stubs' and I partially share his sentiment about creating tests that are to tightly coupled to implementation in this regard (that is if I understood him correctly) however in this case, the code would potentially break if the order of invocation was changed, so perhaps writing a spec to assert this expectation wouldn't be a bad idea???
I'm writing this really quickly so I apologize if it doesn't make sense, I'm just having a brain dump moment
Cheers,
Alex
I have read that article by Fowler 'Mocks Aren't Stubs' and I partially share his sentiment about creating tests that are to tightly coupled to implementation in this regard (that is if I understood him correctly) however in this case, the code would potentially break if the order of invocation was changed, so perhaps writing a spec to assert this expectation wouldn't be a bad idea???
I'm writing this really quickly so I apologize if it doesn't make sense, I'm just having a brain dump moment
Cheers,
Alex