<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Is Moq too poweful?</title><link>http://weblogs.asp.net/rosherove/archive/2008/07/06/is-moq-too-poweful.aspx</link><description>It's interesting to see the other mocking frameworks as they grow into maturity. Especially Moq which has been getting loads of new features recently. The latest one is something which makes me feel a bit weird after reading all the things people fear</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Crowdify Blog  &amp;raquo; Blog Archive   &amp;raquo; Day 1: Get Moq Working</title><link>http://weblogs.asp.net/rosherove/archive/2008/07/06/is-moq-too-poweful.aspx#6762409</link><pubDate>Tue, 02 Dec 2008 05:33:24 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6762409</guid><dc:creator>Crowdify Blog  » Blog Archive   » Day 1: Get Moq Working</dc:creator><author>Crowdify Blog  » Blog Archive   » Day 1: Get Moq Working</author><description>&lt;p&gt;Pingback from &amp;nbsp;Crowdify Blog &amp;nbsp;&amp;amp;raquo; Blog Archive &amp;nbsp; &amp;amp;raquo; Day 1: Get Moq Working&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6762409" width="1" height="1"&gt;</description></item><item><title>re: Is Moq too poweful?</title><link>http://weblogs.asp.net/rosherove/archive/2008/07/06/is-moq-too-poweful.aspx#6423373</link><pubDate>Sun, 20 Jul 2008 10:44:43 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6423373</guid><dc:creator>Cokin Jack</dc:creator><author>Cokin Jack</author><description>&lt;p&gt;Personally I think the discussion on TypeMock will eventually move on. &lt;/p&gt;
&lt;p&gt;Currently everyone says IoC and mocking introduce good design practices, however many then use AMC and (where possible) automatic dependency hookup because really they&amp;#39;re producing IFooService-&amp;gt;FooService style interfaces. &lt;/p&gt;
&lt;p&gt;Truth is good designers produce good designs, where &amp;quot;good&amp;quot; is totally dependent on the problem/environment and other factors&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6423373" width="1" height="1"&gt;</description></item><item><title>re: Is Moq too poweful?</title><link>http://weblogs.asp.net/rosherove/archive/2008/07/06/is-moq-too-poweful.aspx#6386124</link><pubDate>Thu, 10 Jul 2008 22:49:19 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6386124</guid><dc:creator>Troy DeMonbreun</dc:creator><author>Troy DeMonbreun</author><description>&lt;p&gt;My &amp;quot;running with scissors&amp;quot; comment is something I point out in my article on Test Supported Development:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blog.troyd.net/Test+Supported+Development+TSD+Is+NOT+Test+Driven+Development+TDD.aspx"&gt;blog.troyd.net/Test+Supported+Development+TSD+Is+NOT+Test+Driven+Development+TDD.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;quot;TypeMock seems to offer a shortcut around these interface extractions, but some TDDers might feel uncomfortable with the power of such a shortcut as it is incongruent with their valuing of TDD&amp;#39;s IoC enforcement. &lt;/p&gt;
&lt;p&gt;Developers should be free to choose to apply OO design idioms AS THEY SEE FIT. Obviously, good object-oriented design, refactoring, etc. is not exclusively the domain of TDD. Also, I would wager that if developers really wanted an IoC enforcement tool, they would prefer to go searching for (or create) just that [think SRP on a macro level], instead of having it forced upon them as part of a Development Methodology. In fact, a &amp;#39;Design Principle Enforcement Tool&amp;#39; might not be a bad idea, assuming it does not yet exist.&amp;quot;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6386124" width="1" height="1"&gt;</description></item><item><title>re: Is Moq too poweful?</title><link>http://weblogs.asp.net/rosherove/archive/2008/07/06/is-moq-too-poweful.aspx#6380281</link><pubDate>Wed, 09 Jul 2008 14:36:59 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6380281</guid><dc:creator>Will</dc:creator><author>Will</author><description>&lt;p&gt;I just used this to assert that a private field was disposed property. &amp;nbsp;You can&amp;#39;t do this using a mock unless you can access the internal (as the pattern dictates) virtual Dispose(bool) method.&lt;/p&gt;
&lt;p&gt;MoQ FTW.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6380281" width="1" height="1"&gt;</description></item><item><title>re: Is Moq too poweful?</title><link>http://weblogs.asp.net/rosherove/archive/2008/07/06/is-moq-too-poweful.aspx#6376008</link><pubDate>Tue, 08 Jul 2008 12:04:19 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6376008</guid><dc:creator>Kent Boogaart</dc:creator><author>Kent Boogaart</author><description>&lt;p&gt;If Dan had allowed setting expectations on private members, then I&amp;#39;d be worried. The fact is, protected means &amp;quot;public to subclasses&amp;quot;. Moq now lets you more easily test those subclass scenarios.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6376008" width="1" height="1"&gt;</description></item><item><title>re: Is Moq too poweful?</title><link>http://weblogs.asp.net/rosherove/archive/2008/07/06/is-moq-too-poweful.aspx#6374859</link><pubDate>Tue, 08 Jul 2008 04:55:43 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6374859</guid><dc:creator>Daniel Cazzulino</dc:creator><author>Daniel Cazzulino</author><description>&lt;p&gt;BTW, Roy, Moq allows mocking protected properties and methods, NOT fields which cannot be mocked just as you can&amp;#39;t override their get/set in your manual C# code.&lt;/p&gt;
&lt;p&gt;Maybe that was missleading by my wording (&amp;quot;members&amp;quot;), but that&amp;#39;s what the new feature is for. &lt;/p&gt;
&lt;p&gt;We still continue to stay away from voodoo ;)&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6374859" width="1" height="1"&gt;</description></item><item><title>re: Is Moq too poweful?</title><link>http://weblogs.asp.net/rosherove/archive/2008/07/06/is-moq-too-poweful.aspx#6374774</link><pubDate>Tue, 08 Jul 2008 04:33:29 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6374774</guid><dc:creator>Daniel Cazzulino</dc:creator><author>Daniel Cazzulino</author><description>&lt;p&gt;Funny thing to say Chad, since all of a sudden things that were considered &amp;quot;at the core of mocking&amp;quot; (&lt;a rel="nofollow" target="_new" href="http://ayende.com/Blog/archive/2007/12/26/The-RecordReplayVerify-model.aspx"&gt;ayende.com/.../The-RecordReplayVerify-model.aspx&lt;/a&gt;) now are being copied from Moq (no explicit record-reply model), or the mixture of stub and mock behaviors in a single object, or the lambda-based syntax, etc. etc.&lt;/p&gt;
&lt;p&gt;As Nicholas properly points out, mocking protected members is nothing you can&amp;#39;t do with manually created mocks. Moq is there to help you avoid having to create those manual, so it made sense to support something that you can already do (and probably are doing) manually.&lt;/p&gt;
&lt;p&gt;How else would you test that your protected members are being called and the base class is behaving as expected in that case with regards to its consumers? It&amp;#39;s NOT the same as mocking statics. &lt;/p&gt;
&lt;p&gt;I&amp;#39;m surprised that Roy is somehow comparing this to mocking statics &amp;quot;black magic&amp;quot;... &lt;/p&gt;
&lt;p&gt;Depending on statics is bad. My guess is Moq will never support it, no matter how many patches I get to support it. &lt;/p&gt;
&lt;p&gt;Yes, Moq is an &amp;quot;opinionated&amp;quot; framework at that. We want people to fall in the pit of success, not help them shoot their foot so that they learn how NOT to (precisely what Vadim went through).&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6374774" width="1" height="1"&gt;</description></item><item><title>Dew Drop - July 7, 2008 | Alvin Ashcraft's Morning Dew</title><link>http://weblogs.asp.net/rosherove/archive/2008/07/06/is-moq-too-poweful.aspx#6371657</link><pubDate>Mon, 07 Jul 2008 12:46:29 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6371657</guid><dc:creator>Dew Drop - July 7, 2008 | Alvin Ashcraft's Morning Dew</dc:creator><author>Dew Drop - July 7, 2008 | Alvin Ashcraft's Morning Dew</author><description>&lt;p&gt;Pingback from &amp;nbsp;Dew Drop - July 7, 2008 | Alvin Ashcraft&amp;#39;s Morning Dew&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6371657" width="1" height="1"&gt;</description></item><item><title>re: Is Moq too poweful?</title><link>http://weblogs.asp.net/rosherove/archive/2008/07/06/is-moq-too-poweful.aspx#6369034</link><pubDate>Mon, 07 Jul 2008 00:45:30 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6369034</guid><dc:creator>Chad Myers</dc:creator><author>Chad Myers</author><description>&lt;p&gt;Moq never made much sense to me. Daniel&amp;#39;s mocking philosophy seemed to not be anywhere near where everyone else was on mocking. So, frankly, this doesn&amp;#39;t really shock me and makes even less sense, I guess.&lt;/p&gt;
&lt;p&gt;Ayende said that he&amp;#39;d accept a patch for static mocking if someone submitted it to Rhino.Mocks. Like you&amp;#39;ve said, Roy, there are times where you need it.&lt;/p&gt;
&lt;p&gt;Scott Hanselman aptly described TypeMock as a &amp;#39;crowbar&amp;#39; which is a perfect analogy, I think: &lt;/p&gt;
&lt;p&gt;Amazingly useful when its use is appropriate, but rarely is its use appropriate and it can do &amp;nbsp;some damage if not used at the correct time.&lt;/p&gt;
&lt;p&gt;(&lt;a rel="nofollow" target="_new" href="http://tech.groups.yahoo.com/group/altdotnet/message/11195"&gt;tech.groups.yahoo.com/.../11195&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;My beef with TypeMock is not that it sells crowbars, it&amp;#39;s that it sells crowbars as magic tools to solve all problems and that you should continue writing code that only crowbar-like tools can solve. This is harmful to the community, IMHO.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6369034" width="1" height="1"&gt;</description></item><item><title>re: Is Moq too poweful?</title><link>http://weblogs.asp.net/rosherove/archive/2008/07/06/is-moq-too-poweful.aspx#6368324</link><pubDate>Sun, 06 Jul 2008 22:22:39 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6368324</guid><dc:creator>Nicholas Blumhardt</dc:creator><author>Nicholas Blumhardt</author><description>&lt;p&gt;Roy, manually subclassing to create a test double allows for exactly the same behaviour.&lt;/p&gt;
&lt;p&gt;Moq isn&amp;#39;t giving you any power you don&amp;#39;t already have in C#. This technique is pretty common outside of the use of mocking frameworks (it is even listed in xUnit Test Patterns.)&lt;/p&gt;
&lt;p&gt;Don&amp;#39;t think we&amp;#39;re comparing apples with apples here :)&lt;/p&gt;
&lt;p&gt;Nick&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6368324" width="1" height="1"&gt;</description></item></channel></rss>