<?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: Hosting an entire ASP.NET MVC request for testing purposes</title>
	<atom:link href="http://lostechies.com/chadmyers/2008/06/25/hosting-an-entire-asp-net-mvc-request-for-testing-purposes/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/chadmyers/2008/06/25/hosting-an-entire-asp-net-mvc-request-for-testing-purposes/</link>
	<description>Software development, testing, and techie life</description>
	<lastBuildDate>Thu, 08 Mar 2012 22:19:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Sean Scally</title>
		<link>http://lostechies.com/chadmyers/2008/06/25/hosting-an-entire-asp-net-mvc-request-for-testing-purposes/#comment-362</link>
		<dc:creator>Sean Scally</dc:creator>
		<pubDate>Wed, 25 Jun 2008 16:23:05 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/06/24/hosting-an-entire-asp-net-mvc-request-for-testing-purposes.aspx#comment-362</guid>
		<description>@chadmyers

I&#039;d really like to see the contents of each of those four test types that you mention; both what determines what goes in each type, and some examples of each. 

There&#039;s just not enough real-life examples on the web of such a breakdown in .NET projects.</description>
		<content:encoded><![CDATA[<p>@chadmyers</p>
<p>I&#8217;d really like to see the contents of each of those four test types that you mention; both what determines what goes in each type, and some examples of each. </p>
<p>There&#8217;s just not enough real-life examples on the web of such a breakdown in .NET projects.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: erichexter</title>
		<link>http://lostechies.com/chadmyers/2008/06/25/hosting-an-entire-asp-net-mvc-request-for-testing-purposes/#comment-361</link>
		<dc:creator>erichexter</dc:creator>
		<pubDate>Wed, 25 Jun 2008 04:26:06 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/06/24/hosting-an-entire-asp-net-mvc-request-for-testing-purposes.aspx#comment-361</guid>
		<description>While I appreciate the ability to test on the fly without IIS I think you could get similar results with the vs2008 dev webserver.  I am not sure I understand why you would spend the time to do string assertions for the black box end-to-end tests, when you already have your view tests, which could check the state of objects in the webbrowser.  Are you trying to eliminate the need to test multipage transactions in your view tests?  At the end of the day shouldn&#039;t the end-to-end tests drive the browser not the webserver?  

Regardless of the motivation for these tests, I think it is pretty cool that you can do it.
</description>
		<content:encoded><![CDATA[<p>While I appreciate the ability to test on the fly without IIS I think you could get similar results with the vs2008 dev webserver.  I am not sure I understand why you would spend the time to do string assertions for the black box end-to-end tests, when you already have your view tests, which could check the state of objects in the webbrowser.  Are you trying to eliminate the need to test multipage transactions in your view tests?  At the end of the day shouldn&#8217;t the end-to-end tests drive the browser not the webserver?  </p>
<p>Regardless of the motivation for these tests, I think it is pretty cool that you can do it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad Myers</title>
		<link>http://lostechies.com/chadmyers/2008/06/25/hosting-an-entire-asp-net-mvc-request-for-testing-purposes/#comment-360</link>
		<dc:creator>Chad Myers</dc:creator>
		<pubDate>Wed, 25 Jun 2008 03:35:23 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/06/24/hosting-an-entire-asp-net-mvc-request-for-testing-purposes.aspx#comment-360</guid>
		<description>@ScottGu

These are end-to-end &#039;black box&#039; tests, not unit tests. I agree with you vis-a-vis unit tests and we do indeed do that (it&#039;s still somewhat of a challenge due to the abundant use of the *Context classes -- RoutContext, ViewContext, etc).

The reason I&#039;m doing this here (instead of hitting a server) is so that they can be run in an automated fashion without the need for special setup on the box (i.e. on an Continuous Integration server that may not even have IIS installed).

Right now I can check out the code from my SVN repo, build it, and run the tests on an XP box without IIS installed.

We have layered tests that overlap a little, but we try to test different things at the various levels so as to avoid the &quot;break a 1,000 tests when you refactor&quot; problem.

** Unit tests - &lt;2s secs, requires no special setup
** Integration Tests - &lt;1 minute, requires database, maybe test data, some config files
** View Tests - &gt;1 minute usually, involves just the views with minimal HttpContext setup, no HttpRuntime/ApplicationHost involves, WatiN and IE (soon FireFox)
** Black box end-to-end - &gt;1 minute, involves the code above, includes the whole ASP.NET pipeline including URL routing, etc.

The black box tests are usually very specific about what they check and don&#039;t involve a lot of HTML munging or big string comparison -- check that XYZ exists, check that ABC is disabled, check that I get redirected to the login screen, etc.
</description>
		<content:encoded><![CDATA[<p>@ScottGu</p>
<p>These are end-to-end &#8216;black box&#8217; tests, not unit tests. I agree with you vis-a-vis unit tests and we do indeed do that (it&#8217;s still somewhat of a challenge due to the abundant use of the *Context classes &#8212; RoutContext, ViewContext, etc).</p>
<p>The reason I&#8217;m doing this here (instead of hitting a server) is so that they can be run in an automated fashion without the need for special setup on the box (i.e. on an Continuous Integration server that may not even have IIS installed).</p>
<p>Right now I can check out the code from my SVN repo, build it, and run the tests on an XP box without IIS installed.</p>
<p>We have layered tests that overlap a little, but we try to test different things at the various levels so as to avoid the &#8220;break a 1,000 tests when you refactor&#8221; problem.</p>
<p>** Unit tests &#8211; &lt;2s secs, requires no special setup<br />
** Integration Tests - &lt;1 minute, requires database, maybe test data, some config files<br />
** View Tests - >1 minute usually, involves just the views with minimal HttpContext setup, no HttpRuntime/ApplicationHost involves, WatiN and IE (soon FireFox)<br />
** Black box end-to-end &#8211; >1 minute, involves the code above, includes the whole ASP.NET pipeline including URL routing, etc.</p>
<p>The black box tests are usually very specific about what they check and don&#8217;t involve a lot of HTML munging or big string comparison &#8212; check that XYZ exists, check that ABC is disabled, check that I get redirected to the login screen, etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ScottGu</title>
		<link>http://lostechies.com/chadmyers/2008/06/25/hosting-an-entire-asp-net-mvc-request-for-testing-purposes/#comment-359</link>
		<dc:creator>ScottGu</dc:creator>
		<pubDate>Wed, 25 Jun 2008 03:17:55 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2008/06/24/hosting-an-entire-asp-net-mvc-request-for-testing-purposes.aspx#comment-359</guid>
		<description>I would typically recommend that your unit tests test the individual sub-components of your web application (routing, controllers, any custom filters you create, etc), and then only use an approach like above for end to end integration testing of everything (which should hopefully be far fewer tests).

I&#039;m not sure I understand why you need to implement your ExecuteMvcUrl method though - can&#039;t you just send standard URLs to the host and verify that the correct HTML is coming back?  I&#039;m not sure you want/need those end-to-end tests to be aware of which controller is handling what (your unit tests for your routing logic should cover those).  

Potentially I&#039;m missing the uber scenario though.  Feel free to send me email (scottgu@microsoft.com) if you want to drill into it more and I&#039;d be happy to help.

Thanks,

Scott</description>
		<content:encoded><![CDATA[<p>I would typically recommend that your unit tests test the individual sub-components of your web application (routing, controllers, any custom filters you create, etc), and then only use an approach like above for end to end integration testing of everything (which should hopefully be far fewer tests).</p>
<p>I&#8217;m not sure I understand why you need to implement your ExecuteMvcUrl method though &#8211; can&#8217;t you just send standard URLs to the host and verify that the correct HTML is coming back?  I&#8217;m not sure you want/need those end-to-end tests to be aware of which controller is handling what (your unit tests for your routing logic should cover those).  </p>
<p>Potentially I&#8217;m missing the uber scenario though.  Feel free to send me email (scottgu@microsoft.com) if you want to drill into it more and I&#8217;d be happy to help.</p>
<p>Thanks,</p>
<p>Scott</p>
]]></content:encoded>
	</item>
</channel>
</rss>
