{"id":5836,"date":"2014-04-07T09:35:38","date_gmt":"2014-04-07T09:35:38","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/07\/problem-about-partial-mocks-collection-of-common-programming-errors\/"},"modified":"2014-04-07T09:35:38","modified_gmt":"2014-04-07T09:35:38","slug":"problem-about-partial-mocks-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/07\/problem-about-partial-mocks-collection-of-common-programming-errors\/","title":{"rendered":"problem about partial-mocks-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b3ff7a4f79647ff0e5484eeccb9dc1f9?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nChad Kapatch<br \/>\nunit-testing rhino-mocks-3.5 partial-mocks<br \/>\nI am trying to test a class similar to the example below:public class Service : IService {public string A(string input){ int attemptCount = 5;while (attemptCount &gt; 0){try{return TryA(input);}catch (ArgumentOutOfRangeException){attemptCount&#8211;;if (attemptCount == 0){throw;}\/\/ Attempt 5 more timesThread.Sleep(1000); } }throw new ArgumentOutOfRangeException(); }public string TryA(string input){\/\/ try actions, if fail will throw Argum<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Chad Kapatch unit-testing rhino-mocks-3.5 partial-mocks I am trying to test a class similar to the example below:public class Service : IService {public string A(string input){ int attemptCount = 5;while (attemptCount &gt; 0){try{return TryA(input);}catch (ArgumentOutOfRangeException){attemptCount&#8211;;if (attemptCount == 0){throw;}\/\/ Attempt 5 more timesThread.Sleep(1000); } }throw new ArgumentOutOfRangeException(); }public string TryA(string input){\/\/ try actions, if fail will throw [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5836","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5836","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5836"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5836\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5836"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5836"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5836"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}