<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Creating Unit Tests for ASP.NET MVC Applications</title><link>http://www.asp.net</link><pubDate>Mon, 30 Jul 2012 05:27:16 GMT</pubDate><generator>umbraco</generator><description>Comments for Creating Unit Tests for ASP.NET MVC Applications</description><language>en</language><atom:link href="http://www.asp.net/rss/comments/27605" rel="self" type="application/rss+xml" /><item><title>Comment Posted by questsal78</title><link>http://www.asp.net/mvc/tutorials/older-versions/unit-testing/creating-unit-tests-for-asp-net-mvc-applications-cs</link><pubDate>Wed, 21 Jul 2010 04:17:37 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000009537</guid><description><![CDATA[ <p>Thanks very much, very useful article. It&#39;s simple to implement and easy to understand. Good for beginners!</p><p></p><p>cheers!</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/questsal78.jpg?forceidenticon=false&amp;dt=635049653400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by sloper</title><link>http://www.asp.net/mvc/tutorials/older-versions/unit-testing/creating-unit-tests-for-asp-net-mvc-applications-cs</link><pubDate>Thu, 24 Feb 2011 17:37:44 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012219</guid><description><![CDATA[ <p>How can we test controller that uses a IIS intrinsic object(HttpContext or Session)??</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/sloper.jpg?forceidenticon=false&amp;dt=635049653400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by sipi66</title><link>http://www.asp.net/mvc/tutorials/older-versions/unit-testing/creating-unit-tests-for-asp-net-mvc-applications-cs</link><pubDate>Thu, 31 Mar 2011 06:35:22 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012657</guid><description><![CDATA[ <p>A very useful post - thanks. Just one thing, the assert in listing 6 should read:</p><p></p><p>Assert.AreEqual(&quot;Index&quot;, result.RouteValues[&quot;action&quot;]);</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/sipi66.jpg?forceidenticon=false&amp;dt=635049653400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by haagel</title><link>http://www.asp.net/mvc/tutorials/older-versions/unit-testing/creating-unit-tests-for-asp-net-mvc-applications-cs</link><pubDate>Wed, 09 Nov 2011 03:55:40 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014587</guid><description><![CDATA[ <p>The test that the action returns the correct view doesn&#39;t work as you would think... Let&#39;s say you do this (as in the example above):</p><p>Assert.AreEqual(&quot;Details&quot;, result.ViewName);</p><p>This will only test that you called the View() method like this:</p><p>View(&quot;Details&quot;);</p><p>Try changing the code to this:</p><p>View(&quot;ANameOfAViewThatIReallyDontHave&quot;);</p><p>And change the test to this:</p><p>Assert.AreEqual(&quot;ANameOfAViewThatIReallyDontHave&quot;, result.ViewName);</p><p>The test will be succesful, even though your application obviously will not. Apparently the name of the view is just set to whatever you write as a paramter in the View() method...</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/haagel.jpg?forceidenticon=false&amp;dt=635049653400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by haagel</title><link>http://www.asp.net/mvc/tutorials/older-versions/unit-testing/creating-unit-tests-for-asp-net-mvc-applications-cs</link><pubDate>Wed, 09 Nov 2011 04:17:24 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014588</guid><description><![CDATA[ <p>I guess the ViewResult is an instruction to the next step in the pipeline and not the view itself. Thus checking this ViewName property is relevant in the sense that you are checking that the instruction to which view to use is correct. The controller is not responsible of finding the view itself.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/haagel.jpg?forceidenticon=false&amp;dt=635049653400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by nileshgrace</title><link>http://www.asp.net/mvc/tutorials/older-versions/unit-testing/creating-unit-tests-for-asp-net-mvc-applications-cs</link><pubDate>Mon, 30 Jul 2012 05:27:16 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016066</guid><description><![CDATA[ <p>How to test insertion of the record in DB ? </p><p>I understand above code, but what if I want to check whether record is successfully stored or not ? </p><p>How to test this  ? </p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/nileshgrace.jpg?forceidenticon=false&amp;dt=635049653400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>