.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

php - trouble displaying mysqli database results in correct order -

depending on nth recurrence of job in control M -

sql server - Cannot query correctly (MSSQL - PHP - JSON) -