<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Asp.Net MVC without &#8216;The framework&#8217; Part 2: a good example of Unit Testing</title>
	<atom:link href="http://www.ronaldwidha.net/2009/03/22/aspnet-mvc-without-the-framework-part-2-a-good-example-of-unit-testing/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ronaldwidha.net/2009/03/22/aspnet-mvc-without-the-framework-part-2-a-good-example-of-unit-testing/</link>
	<description>podcast addict, believes in occam razor, software consultant</description>
	<lastBuildDate>Fri, 30 Jul 2010 18:24:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ronald Widha &#187; Blog Archive &#187; Model View Presenter on Asp.Net using WebFormsMVP framework</title>
		<link>http://www.ronaldwidha.net/2009/03/22/aspnet-mvc-without-the-framework-part-2-a-good-example-of-unit-testing/comment-page-1/#comment-475</link>
		<dc:creator>Ronald Widha &#187; Blog Archive &#187; Model View Presenter on Asp.Net using WebFormsMVP framework</dc:creator>
		<pubDate>Sun, 30 May 2010 17:18:56 +0000</pubDate>
		<guid isPermaLink="false">/Articles/Asp.Net-MVC-without-'The-framework'-Part-2:-a-good-example-of-Unit-Testing.aspx#comment-475</guid>
		<description>[...] on opting for MVC pattern on Asp.net Webform (Asp.Net MVC without using ‘the framework part1 and part 2: a good example of unit testing). A few months ago, I heard about Tatham Oddie’s project WebForms MVP, which until yesterday I [...]</description>
		<content:encoded><![CDATA[<p>[...] on opting for MVC pattern on Asp.net Webform (Asp.Net MVC without using ‘the framework part1 and part 2: a good example of unit testing). A few months ago, I heard about Tatham Oddie’s project WebForms MVP, which until yesterday I [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ronaldwidha</title>
		<link>http://www.ronaldwidha.net/2009/03/22/aspnet-mvc-without-the-framework-part-2-a-good-example-of-unit-testing/comment-page-1/#comment-454</link>
		<dc:creator>ronaldwidha</dc:creator>
		<pubDate>Sun, 14 Mar 2010 08:22:55 +0000</pubDate>
		<guid isPermaLink="false">/Articles/Asp.Net-MVC-without-'The-framework'-Part-2:-a-good-example-of-Unit-Testing.aspx#comment-454</guid>
		<description>Martin, parameterized repository method should be treated the same way.&lt;br&gt;To mock a parameterized method you can do the following with RhinoMock:&lt;br&gt;&lt;br&gt;Expect.Call(() =&gt; carRepository.FindById(expectedId))&lt;br&gt;                .Return(something)&lt;br&gt;                .Message(&quot;CarRepository.FindById isn&#039;t called&quot;);&lt;br&gt;&lt;br&gt;or with the AAA syntax&lt;br&gt;CarRepository.AssertWasCalled( x =&gt; x.FindById(expectedId));&lt;br&gt;&lt;br&gt;or with Moq&lt;br&gt;CarRepositoryMock.Setup(x =&gt; x.FindById(expectedId))&lt;br&gt;                .Returns(something);&lt;br&gt;&lt;br&gt;The reason ppl don&#039;t give examples on parameterized repository method test is because it is NOT a part of MVC. You should google for &quot;examples unit testing&quot;. That is just the basics of unit testing.</description>
		<content:encoded><![CDATA[<p>Martin, parameterized repository method should be treated the same way.<br />To mock a parameterized method you can do the following with RhinoMock:</p>
<p>Expect.Call(() =&gt; carRepository.FindById(expectedId))<br />                .Return(something)<br />                .Message(&#8220;CarRepository.FindById isn&#39;t called&#8221;);</p>
<p>or with the AAA syntax<br />CarRepository.AssertWasCalled( x =&gt; x.FindById(expectedId));</p>
<p>or with Moq<br />CarRepositoryMock.Setup(x =&gt; x.FindById(expectedId))<br />                .Returns(something);</p>
<p>The reason ppl don&#39;t give examples on parameterized repository method test is because it is NOT a part of MVC. You should google for &#8220;examples unit testing&#8221;. That is just the basics of unit testing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: martinokello</title>
		<link>http://www.ronaldwidha.net/2009/03/22/aspnet-mvc-without-the-framework-part-2-a-good-example-of-unit-testing/comment-page-1/#comment-453</link>
		<dc:creator>martinokello</dc:creator>
		<pubDate>Sun, 14 Mar 2010 04:14:40 +0000</pubDate>
		<guid isPermaLink="false">/Articles/Asp.Net-MVC-without-'The-framework'-Part-2:-a-good-example-of-Unit-Testing.aspx#comment-453</guid>
		<description>I have looked at numerous repository representations but still failed to see how one would mock a repository method that takes a parameter e.g.&lt;br&gt;&lt;br&gt;interface IProduct{&lt;br&gt;&lt;br&gt;IProduct GetProductId(int id);&lt;br&gt;}&lt;br&gt;&lt;br&gt;Every where people use tests on GetAllProducts(). How can one test using Moq or generate implementations to test a method such as in the interface above.&lt;br&gt;&lt;br&gt;There is something wrong with Moq testing according to my understanding. Why is every body using GetAll() as a representation of the Moq tests in Repository methods, yet methods that take paramters should be tested. Does any one understand MVC out there??? I truly don&#039;t see why nobody gives an example of parametized Repository method tests.....</description>
		<content:encoded><![CDATA[<p>I have looked at numerous repository representations but still failed to see how one would mock a repository method that takes a parameter e.g.</p>
<p>interface IProduct{</p>
<p>IProduct GetProductId(int id);<br />}</p>
<p>Every where people use tests on GetAllProducts(). How can one test using Moq or generate implementations to test a method such as in the interface above.</p>
<p>There is something wrong with Moq testing according to my understanding. Why is every body using GetAll() as a representation of the Moq tests in Repository methods, yet methods that take paramters should be tested. Does any one understand MVC out there??? I truly don&#39;t see why nobody gives an example of parametized Repository method tests&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Teman Macet &#187; Blog Archive &#187; #13 dari TDD sampai BDD</title>
		<link>http://www.ronaldwidha.net/2009/03/22/aspnet-mvc-without-the-framework-part-2-a-good-example-of-unit-testing/comment-page-1/#comment-346</link>
		<dc:creator>Teman Macet &#187; Blog Archive &#187; #13 dari TDD sampai BDD</dc:creator>
		<pubDate>Sun, 12 Jul 2009 18:29:29 +0000</pubDate>
		<guid isPermaLink="false">/Articles/Asp.Net-MVC-without-'The-framework'-Part-2:-a-good-example-of-Unit-Testing.aspx#comment-346</guid>
		<description>[...] Notes example to unit test   berbagi dengan yang [...]</description>
		<content:encoded><![CDATA[<p>[...] Notes example to unit test   berbagi dengan yang [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.ronaldwidha.net/2009/03/22/aspnet-mvc-without-the-framework-part-2-a-good-example-of-unit-testing/comment-page-1/#comment-296</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 30 Apr 2009 15:04:00 +0000</pubDate>
		<guid isPermaLink="false">/Articles/Asp.Net-MVC-without-'The-framework'-Part-2:-a-good-example-of-Unit-Testing.aspx#comment-296</guid>
		<description>&lt;p&gt;@SanjeevAgarwal hey man. yes I am. My email is ronaldwidha (at) gmail dot com. let&#039;s hook up&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@SanjeevAgarwal hey man. yes I am. My email is ronaldwidha (at) gmail dot com. let&#8217;s hook up</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.ronaldwidha.net/2009/03/22/aspnet-mvc-without-the-framework-part-2-a-good-example-of-unit-testing/comment-page-1/#comment-295</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 30 Apr 2009 14:57:00 +0000</pubDate>
		<guid isPermaLink="false">/Articles/Asp.Net-MVC-without-'The-framework'-Part-2:-a-good-example-of-Unit-Testing.aspx#comment-295</guid>
		<description>&lt;p&gt;Ronald,&lt;/p&gt;
&lt;p&gt;           Thansk for comment. Are you from Dubai?. I am also from Dubai, Working in Emirates Airline IT Dept. &lt;/p&gt;
&lt;p&gt;Sanjeev&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Ronald,</p>
<p>           Thansk for comment. Are you from Dubai?. I am also from Dubai, Working in Emirates Airline IT Dept. </p>
<p>Sanjeev</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.ronaldwidha.net/2009/03/22/aspnet-mvc-without-the-framework-part-2-a-good-example-of-unit-testing/comment-page-1/#comment-294</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Fri, 10 Apr 2009 05:49:00 +0000</pubDate>
		<guid isPermaLink="false">/Articles/Asp.Net-MVC-without-'The-framework'-Part-2:-a-good-example-of-Unit-Testing.aspx#comment-294</guid>
		<description>&lt;p&gt;@Fajar Endra Nusa &lt;/p&gt;
&lt;p&gt;That&#039;s why it&#039;s called &#039;unit&#039; testing right? (-:&lt;/p&gt;
&lt;p&gt;Thanks for the links.&lt;/p&gt;
&lt;p&gt;I specifically enjoy the 2nd link by Peter Provost. He uses the same technique to implement Model View Presenter / Supervising Controller in the article.&lt;/p&gt;
&lt;p&gt;Looking forward to read ur posts on it.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Fajar Endra Nusa </p>
<p>That&#8217;s why it&#8217;s called &#8216;unit&#8217; testing right? (-:</p>
<p>Thanks for the links.</p>
<p>I specifically enjoy the 2nd link by Peter Provost. He uses the same technique to implement Model View Presenter / Supervising Controller in the article.</p>
<p>Looking forward to read ur posts on it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.ronaldwidha.net/2009/03/22/aspnet-mvc-without-the-framework-part-2-a-good-example-of-unit-testing/comment-page-1/#comment-293</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 09 Apr 2009 07:36:00 +0000</pubDate>
		<guid isPermaLink="false">/Articles/Asp.Net-MVC-without-'The-framework'-Part-2:-a-good-example-of-Unit-Testing.aspx#comment-293</guid>
		<description>&lt;p&gt;Yet another good example with compact explanation, indeed : )&lt;/p&gt;
&lt;p&gt;I&#039;m going to write about mocking also, in my Unit Testing series. Unfortunately, to me... to find a perfect time to start writing is rather harder than to sleep : ( at least, for recently.&lt;/p&gt;
&lt;p&gt;There are two articles in CodeProject I like the most, talking about Unit Testing. The first one is Advanced Unit Testing series by Marc Clifton: http://www.codeproject.com/KB/cs/autp1.aspx, and the second one is Test-Driven Development in .NET by Peter Provost: http://www.codeproject.com/KB/dotnet/tdd_in_dotnet.aspx.&lt;/p&gt;
&lt;p&gt;We can find Peter shows another example how to test a controller in the second link I just gave.&lt;/p&gt;
&lt;p&gt;However, unit testing is intended to be well isolated from any external parts of the target object. That&#039;s why mock object come up with such a cool job.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Yet another good example with compact explanation, indeed : )</p>
<p>I&#8217;m going to write about mocking also, in my Unit Testing series. Unfortunately, to me&#8230; to find a perfect time to start writing is rather harder than to sleep : ( at least, for recently.</p>
<p>There are two articles in CodeProject I like the most, talking about Unit Testing. The first one is Advanced Unit Testing series by Marc Clifton: <a href="http://www.codeproject.com/KB/cs/autp1.aspx" rel="nofollow">http://www.codeproject.com/KB/cs/autp1.aspx</a>, and the second one is Test-Driven Development in .NET by Peter Provost: <a href="http://www.codeproject.com/KB/dotnet/tdd_in_dotnet.aspx" rel="nofollow">http://www.codeproject.com/KB/dotnet/tdd_in_dotnet.aspx</a>.</p>
<p>We can find Peter shows another example how to test a controller in the second link I just gave.</p>
<p>However, unit testing is intended to be well isolated from any external parts of the target object. That&#8217;s why mock object come up with such a cool job.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
