tag:blogger.com,1999:blog-8619555037506461466.post3324950879576079144..comments2018-08-18T07:47:45.858+02:00Comments on Garajeando: First clumsy tests using Phake test doubles frameworkManuel Riverohttp://www.blogger.com/profile/03913204576202587259noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-8619555037506461466.post-9776795027758386132014-03-30T22:03:56.968+02:002014-03-30T22:03:56.968+02:00Thanks for your feedback, Carlos.
I don't lik...Thanks for your feedback, Carlos.<br /><br />I don't like the class name either, I'm still struggling with it.<br />I imagined the class as representing an "action" so the name tried to describe the action. I don't have more types of actions yet so I'm not using a Command pattern.<br /><br />I'll try passing the form too see how it feels.<br />This will also allow me to remove the word form from the names of both the "action" and its collaborators.<br /><br />You're totally right, I could perfectly remove line 32 (already removed).<br /><br />I also added an example of how I'm using the class.<br /><br />Thank you very much.<br /><br />Best regards,<br />MManuel Riverohttps://www.blogger.com/profile/03913204576202587259noreply@blogger.comtag:blogger.com,1999:blog-8619555037506461466.post-53012310698106384612014-03-30T19:29:33.998+02:002014-03-30T19:29:33.998+02:00I don't really like the name of the class but ...I don't really like the name of the class but it's because I don't have any other context. It may be OK if you are using the Command pattern. As a consumer of the API I would expect the "form" object to be passed in to "execute".<br /><br />Maybe the tests are trying to tell you something about your design. It could be an interesting experiment, using mocks rather than spies. In the tests, I would put lines 32 and 33 in different tests. Of just remove line 32. Ideally tests should fail for a single reason.<br /><br />Interesting problem and interesting post, thank you :-)Carlos Blehttps://www.blogger.com/profile/11725316445550287619noreply@blogger.com