{"id":211,"date":"2007-03-06T23:14:17","date_gmt":"2007-03-06T22:14:17","guid":{"rendered":"http:\/\/soci.hu\/blog\/index.php\/2007\/03\/06\/mocks-arent-stubs\/"},"modified":"2007-03-06T23:14:17","modified_gmt":"2007-03-06T22:14:17","slug":"mocks-arent-stubs","status":"publish","type":"post","link":"https:\/\/soci.hu\/blog\/index.php\/2007\/03\/06\/mocks-arent-stubs\/","title":{"rendered":"Mocks Aren&#8217;t Stubs"},"content":{"rendered":"<p>Martin Fowler b\u00e1ty\u00f3 szok\u00e1s szerint <a href=\"http:\/\/martinfowler.com\/articles\/mocksArentStubs.html\">\u00e9lesl\u00e1t\u00f3an \u00edr<\/a>, ez\u00fattal a k\u00fcl\u00f6nb\u00f6z\u0151 Unit tesztel\u00e9si m\u00f3dszereket elemzi ki.<\/p>\n<p>R\u00e1 kellett j\u00f6jjek a cikk alapj\u00e1n, hogy a DP tanfolyamon Mockk\u00e9nt tan\u00edtott objektumok val\u00f3j\u00e1ban Fake objektumok voltak. Mert hogy:<\/p>\n<ul>\n<li>Dummy objects are passed around but never actually used. Usually they are just used to fill parameter lists.<\/li>\n<li>Fake objects actually have working implementations, but usually take some shortcut which makes them not suitable for production (an in memory database is a good example).\n<\/li>\n<li>Stubs provide canned answers to calls made during the test, usually not responding at all to anything outside what&#8217;s programmed in for the test. Stubs may also record information about calls, such as an email gateway stub that remembers the messages it &#8216;sent&#8217;, or maybe only how many messages it &#8216;sent&#8217;.\n<\/li>\n<li>Mocks are what we are talking about here: objects pre-programmed with expectations which form a specification of the calls they are expected to receive.\n<\/li>\n<\/ul>\n<p>\u00c9rdemes r\u00e1sz\u00e1nni t\u00edz percet, tudatt\u00e1g\u00edt\u00f3 hat\u00e1s\u00fa cikk.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Martin Fowler b\u00e1ty\u00f3 szok\u00e1s szerint \u00e9lesl\u00e1t\u00f3an \u00edr, ez\u00fattal a k\u00fcl\u00f6nb\u00f6z\u0151 Unit tesztel\u00e9si m\u00f3dszereket elemzi ki. R\u00e1 kellett j\u00f6jjek a cikk alapj\u00e1n, hogy&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,42],"tags":[],"class_list":["post-211","post","type-post","status-publish","format-standard","hentry","category-szakmai-elet","category-testing"],"_links":{"self":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=211"}],"version-history":[{"count":0,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/211\/revisions"}],"wp:attachment":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}