tag:blogger.com,1999:blog-1332658215967116572.post4248789816258608242..comments2023-07-11T15:50:52.564-07:00Comments on CodeJargon: Mocking frameworks vs Unit Testing styleZsolt Herpaihttp://www.blogger.com/profile/14746339051886806979noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-1332658215967116572.post-89233000931214552452011-05-13T23:48:05.294-07:002011-05-13T23:48:05.294-07:00verify(greetingFormula, times(1)).formula(); is no...verify(greetingFormula, times(1)).formula(); is not necessary. You have already verified it with this line:<br />when(greetingFormula.formula()).thenReturn(formulaText);Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1332658215967116572.post-58827694770288025422011-05-06T11:22:19.116-07:002011-05-06T11:22:19.116-07:00A slight nit: your usage of times(1) isn't nec...A slight nit: your usage of times(1) isn't necessary (perhaps you did it to illustrate some point that's gone over my head), since verify(mockObject) implicitly uses times(1). Nothing major, but it doesn't hurt to reduce the verbosity of code by just a tinge. :)Anonymoushttps://www.blogger.com/profile/02731325487069494905noreply@blogger.comtag:blogger.com,1999:blog-1332658215967116572.post-38518171382452980932011-05-06T07:52:18.476-07:002011-05-06T07:52:18.476-07:00I enjoy the 'test-spy' mocking style becau...I enjoy the 'test-spy' mocking style because it follows the standard test flow (set-up, verification, teardown). Besides Mockito, there are a few other testing frameworks that I've come across that support this style<br /><br /> * Bourne (https://github.com/thoughtbot/bourne) - Ruby<br /> * RR (https://github.com/btakita/rr) - Ruby<br /> * Jasmine (https://github.com/pivotal/jasmine/wiki/Spies) - JavaScript<br /><br />Check 'em out!Nate Smithhttps://www.blogger.com/profile/09509991213275220829noreply@blogger.com