.net - Forgetting to Verify Expectations on RhinoMock mock objects -


i discovered couple of unit tests not testing should...

{   var mockx = mockrepository.generatemock<x>();   var mocky = mockrepository.generatemock<y>();    var test = new something(mockx,mocky);    mockx.expect(...);   mocky.expect(...);    test.dothething(...);    mockx.verifyallexpectations(); } 

the issue... expectation on mocky never verified. suppose i'd expected rhino warn me of such things.

i think in real-life case added dependency on y after test written, , amended test crucially forgot additional verification call.

does rhinomocks provide single checkallexpectationsonallmocks method perhaps? or other way such issues? me seems dangerous when dealing multiple mock objects write expectations , don't realise they're not being checked... opposed assert either write code or don't!


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -