<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><!--RSS generated by Windows SharePoint Services V3 RSS Generator on 23/12/2010 13:24:19--><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Enrique Blanco</title><link>http://blogs.renacimiento.com/eblanco</link><description>RSS feed for the Posts list.</description><lastBuildDate>Thu, 23 Dec 2010 12:24:19 GMT</lastBuildDate><generator>SharePoint CKS:EBE</generator><ttl>60</ttl><image><title>Enrique Blanco</title><url>http://blogs.renacimiento.com/eblanco/_layouts/images/homepage.gif</url><link>http://blogs.renacimiento.com/eblanco</link></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/eblanco" /><feedburner:info uri="eblanco" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>The laziest programmer at Microsoft...</title><link>http://feedproxy.google.com/~r/eblanco/~3/HuouRQ_8YZs/the-laziest-programmer-at-microsoft.aspx</link><guid isPermaLink="false">/eblanco/archive/2010/11/18/the-laziest-programmer-at-microsoft.aspx</guid><description>&lt;div class="ExternalClass903DE31498AA4007A5234F4A285ABDB0"&gt;
&lt;p&gt;… was the one that make this “feature” –&amp;gt; Use a dedicated web front end computer for crawling:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.renacimiento.com/eblanco/Media/Windows-Live-Writer/The-laziest-programmer-at-Microsoft_12207/image_4_2.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px" title="image_4" border="0" alt="image_4" src="http://blogs.renacimiento.com/eblanco/Media/Windows-Live-Writer/The-laziest-programmer-at-Microsoft_12207/image_4_thumb.png" width="644" height="178"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can think: “Oh that’s cool so I can derive all the crawling load to a single server and take it out of the NLB so the public facing servers don’t get affected by the crawler overhead”.&lt;/p&gt;
&lt;p&gt;And I will say “Fuck Yeah! That’s true! It can be really useful when you have a really tough indexing needs but…”&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The “but part” is that a programmer that respects him/herself MUST find a better way to accomplish this than writing on the index server’s hosts file  your farm NLB name pointing to that server IP!!!&lt;/strong&gt;. &lt;/p&gt;
&lt;p&gt;Then one happy day in your moss paradise… some other application you’ve just installed in the server starts failing (in my case some Veritas stuff) and after a few minutes/hours/attempts/insults/frustration you realize that the cause is a line like this in your hosts file:&lt;/p&gt;
&lt;p&gt;192.168.1.105 &lt;a href="http://www.myportal.com/"&gt;www.myportal.com&lt;/a&gt; # Added by Office SharePoint Server Search (7/30/2010 8:28 PM).&lt;/p&gt;
&lt;p&gt;So, here’s the solution, simply don’t use that feature. Yeah I know that adding the feature only took… ten minutes? but if you take into account all the hours this crap has taken all over the world...&lt;/p&gt;
&lt;p&gt;And please, Lazy Programmer  at MS, take your job more seriously. &lt;strong&gt;Every time someone like you makes stuff this crappier, god kills a kitten&lt;/strong&gt;.&lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=vvvx6IDdIic:CVYrLF7Q0L0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=vvvx6IDdIic:CVYrLF7Q0L0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=vvvx6IDdIic:CVYrLF7Q0L0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/eblanco/~4/HuouRQ_8YZs" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Enrique Blanco</dc:creator><pubDate>Thu, 18 Nov 2010 20:53:00 GMT</pubDate><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/MOSS/WSS/default.aspx">MOSS/WSS</category><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/Bugs/default.aspx">Bugs</category><feedburner:origLink>http://blogs.renacimiento.com/eblanco/archive/2010/11/18/the-laziest-programmer-at-microsoft.aspx</feedburner:origLink></item><item><title>Cannot run Code Metrics over a SharePoint Visual Studio Project</title><link>http://feedproxy.google.com/~r/eblanco/~3/yIqDpf7eQ4M/cannot-run-code-metrics-over-a-sharepoint-visual-studio-project.aspx</link><guid isPermaLink="false">/eblanco/archive/2010/11/17/cannot-run-code-metrics-over-a-sharepoint-visual-studio-project.aspx</guid><description>&lt;div class="ExternalClass9D2744D5C8B64FDE9AB4D5BF7AA14222"&gt;&lt;p&gt;As you know Visual Studio (in some editions) has a code metrics analyzer that helps you identifying weak spots in your code design (excessive number of lines, cyclomatic complexity,..) and gives you a general maintainability index for your projects.&lt;/p&gt;  &lt;p&gt;Yesterday I tried to run the test over some SharePoint projects and it crashed with this error:&lt;/p&gt;  &lt;p&gt;Message: An error occurred while calculating code metrics for target file 'Meh.SedeV1.Modules.dll' in project Meh.SedeV1.Modules. The following error was encountered while reading module &lt;strong&gt;'Microsoft.SharePoint': Could not resolve type: T ObjectModel&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;After looking for a solution for a while I found that &lt;strong&gt;if your project references “Microsoft.SharePoint.dll” then, in order for the code metrics to run, you must also reference “Microsoft.SharePoint.Security.dll”&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;Add that reference to your project and it will work.&lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=bj5HAu62Jo0:Hewp3Vyayg0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=bj5HAu62Jo0:Hewp3Vyayg0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=bj5HAu62Jo0:Hewp3Vyayg0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/eblanco/~4/yIqDpf7eQ4M" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Enrique Blanco</dc:creator><pubDate>Wed, 17 Nov 2010 23:24:10 GMT</pubDate><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/Bugs/default.aspx">Bugs</category><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/MOSS/WSS/default.aspx">MOSS/WSS</category><feedburner:origLink>http://blogs.renacimiento.com/eblanco/archive/2010/11/17/cannot-run-code-metrics-over-a-sharepoint-visual-studio-project.aspx</feedburner:origLink></item><item><title>Enabling IE9 Platform Preview 6 user interface</title><link>http://feedproxy.google.com/~r/eblanco/~3/LorA22A6InE/enabling-ie9-platform-preview-6-user-interface.aspx</link><guid isPermaLink="false">/eblanco/archive/2010/11/09/enabling-ie9-platform-preview-6-user-interface.aspx</guid><description>&lt;div class="ExternalClass234BF73874CB4875932711D4F2ECCE98"&gt;&lt;p&gt;When I downloaded IE9 Beta I had a  very annoying problem with it, it didn’t show my iGoogle page the right way &lt;img style="border-bottom-style:none;border-left-style:none;border-top-style:none;border-right-style:none" class="wlEmoticon wlEmoticon-sadsmile" alt="Sad smile" src="http://blogs.renacimiento.com/eblanco/Media/Windows-Live-Writer/Enabling-IE9_981C/wlEmoticon-sadsmile_2.png"&gt;. With the Platform Preview 6 release that was fixed, but it lacked a proper user interface. I did not know why it didn’t get the beta UI since the beta was already out, but it left the PP6 almost unusable for everyday use (yes, I know it is not intended for that).&lt;/p&gt;  &lt;p&gt;Well the main point is that I really wanted to use IE9, the more you use beta/PP versions the more info the development teams have, and the best product they made.&lt;/p&gt;  &lt;p&gt;And I found this Ars Technica article showing &lt;a href="http://arstechnica.com/microsoft/news/2010/10/ie9-preview-6-available-now-with-sekrit-beta-ui.ars"&gt;how to give the PP6 the Beta UI&lt;/a&gt;:&lt;/p&gt;  &lt;blockquote&gt;   &lt;ol&gt;     &lt;li&gt;Install IE9 Beta on your machine. You can download IE9 Beta from &lt;a href="http://www.beautyoftheweb.com"&gt;www.beautyoftheweb.com&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;Install Internet Explorer Platform Preview 6. You can download Platform Preview 6 from &lt;a href="http://www.ietestdrive.com"&gt;www.ietestdrive.com&lt;/a&gt; &lt;/li&gt;      &lt;li&gt;Create a folder on your Desktop called IE9_PP6 &lt;/li&gt;      &lt;li&gt;Copy the iexplore.exe file from the C:/Program Files/Internet Explorer directory (or C:/Program Files (x86)/Internet Explorer if you are on a 64 bit machine) to the IE9_PP6 folder &lt;/li&gt;      &lt;li&gt;Create a folder inside IE9_PP6 called iexplore.exe.local (Note: It is imperative that you name this folder exactly as specified) &lt;/li&gt;      &lt;li&gt;Navigate to the Internet Explorer Platform Preview directory within Program files (commonly on 32 bit machines this will be at C:/Program Files/Internet Explorer Platform Preview and on 64 bit machines this will be at C:/Program Files (x86)/Internet Explorer Platform Preview) &lt;/li&gt;      &lt;li&gt;Copy the contents of the iepreview.exe.local folder within the Internet Explorer Platform Preview directory to the iexplore.exe.local folder within IE9_PP6 &lt;/li&gt;      &lt;li&gt;Close all instances of IE running on your machine and run iexplore.exe from IE9_PP6&lt;/li&gt;   &lt;/ol&gt; &lt;/blockquote&gt;  &lt;p&gt;And that’s all, Here is the difference with my Google tasks pane before and after using PP6, quite a difference!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.renacimiento.com/eblanco/Media/Windows-Live-Writer/Enabling-IE9_981C/ie9beforeAfter_2.jpg"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;margin:;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px" title="ie9beforeAfter" border="0" alt="ie9beforeAfter" src="http://blogs.renacimiento.com/eblanco/Media/Windows-Live-Writer/Enabling-IE9_981C/ie9beforeAfter_thumb.jpg" width="644" height="406"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Hope it helps!&lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=Pe7bl1T_W30:klO--KCHbrw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=Pe7bl1T_W30:klO--KCHbrw:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=Pe7bl1T_W30:klO--KCHbrw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/eblanco/~4/LorA22A6InE" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Enrique Blanco</dc:creator><pubDate>Tue, 09 Nov 2010 11:06:16 GMT</pubDate><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/Internet/default.aspx">Internet</category><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/User Experience/default.aspx">User Experience</category><feedburner:origLink>http://blogs.renacimiento.com/eblanco/archive/2010/11/09/enabling-ie9-platform-preview-6-user-interface.aspx</feedburner:origLink></item><item><title>ASP.NET Security Advisory 2416728 Vulnerability. Some links</title><link>http://feedproxy.google.com/~r/eblanco/~3/j-qivqiQrDk/asp-net-security-advisory-2416728-vulnerability-some-links.aspx</link><guid isPermaLink="false">/eblanco/archive/2010/09/21/asp-net-security-advisory-2416728-vulnerability-some-links.aspx</guid><description>&lt;div class="ExternalClass3947005B3D0649128DF44F64971CDA02"&gt;&lt;p&gt;I’m trying to get some useful links regarding the 0-day exploit discovered in ASP.NET &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;This is the official MS note: &lt;a href="https://www.microsoft.com/technet/security/advisory/2416728.mspx"&gt;https://www.microsoft.com/technet/security/advisory/2416728.mspx&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;This is a video of an attack to a DotNetNuke Test Site: &lt;a href="http://www.troyhunt.com/2010/09/fear-uncertainty-and-and-padding-oracle.html"&gt;http://www.troyhunt.com/2010/09/fear-uncertainty-and-and-padding-oracle.html&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;This is a FAQ from ScottGu: &lt;a href="http://weblogs.asp.net/scottgu/archive/2010/09/20/frequently-asked-questions-about-the-asp-net-security-vulnerability.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2010/09/20/frequently-asked-questions-about-the-asp-net-security-vulnerability.aspx&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;TEMPORARY&lt;/strong&gt; SOLUTIONS:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;This is the first post I read from ScottGu: &lt;a href="http://weblogs.asp.net/scottgu/archive/2010/09/20/frequently-asked-questions-about-the-asp-net-security-vulnerability.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2010/09/20/frequently-asked-questions-about-the-asp-net-security-vulnerability.aspx&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Some info regarding Sharepoint specifically: &lt;a href="http://blogs.msdn.com/b/sharepoint/archive/2010/09/21/security-advisory-2416728-vulnerability-in-asp-net-and-sharepoint.aspx"&gt;http://blogs.msdn.com/b/sharepoint/archive/2010/09/21/security-advisory-2416728-vulnerability-in-asp-net-and-sharepoint.aspx&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;This is an http module to patch your applications until the fix is released: &lt;a href="http://oraclebugfix.codeplex.com/"&gt;http://oraclebugfix.codeplex.com/&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Implement the fix ASAP!!&lt;/p&gt;  &lt;p&gt;Hope it helps!!&lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=gANgBiiFvZs:7XXBRzWqrMw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=gANgBiiFvZs:7XXBRzWqrMw:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=gANgBiiFvZs:7XXBRzWqrMw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/eblanco/~4/j-qivqiQrDk" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Enrique Blanco</dc:creator><pubDate>Tue, 21 Sep 2010 23:25:53 GMT</pubDate><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/Bugs/default.aspx">Bugs</category><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/MOSS/WSS/default.aspx">MOSS/WSS</category><feedburner:origLink>http://blogs.renacimiento.com/eblanco/archive/2010/09/21/asp-net-security-advisory-2416728-vulnerability-some-links.aspx</feedburner:origLink></item><item><title>MOSS cache with different Alternate Access Mappings</title><link>http://feedproxy.google.com/~r/eblanco/~3/h9m9FhGEQ58/moss-cache-with-different-alternate-access-mappings.aspx</link><guid isPermaLink="false">/eblanco/archive/2010/09/08/moss-cache-with-different-alternate-access-mappings.aspx</guid><description>&lt;div class="ExternalClass90D702E8016E4496BD4813094B5218DF"&gt;&lt;p&gt;This is something very similar to the issue I found when I realized that  &lt;a title="http://blogs.renacimiento.com/eblanco/archive/2010/02/03/moss-cache-in-https-sites.aspx" href="http://blogs.renacimiento.com/eblanco/archive/2010/02/03/moss-cache-in-https-sites.aspx"&gt;MOSS cache does not distinguish between http and https&lt;/a&gt;. Today I realized that in my setup moss does not distinguish between hostnames.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The situation is this:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I have a web application that must be accesed by more than one hostheader, I don’t want to do complex things such as extending the app and so, in part because the application must be accesible over https and host headers and SSL don’t work very well on the same IP.&lt;/p&gt;  &lt;p&gt;So I setup the AAM in this way:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Default: portal.domain.aaa&lt;/li&gt;    &lt;li&gt;Extranet: external1.domain.es&lt;/li&gt;    &lt;li&gt;Internet: external2.domain.com&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So you can access the same portal by the three addresses (as long as you configure the hostheaders in the front-ends) without any extended web applications.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The problem was:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;While doing the testing we saw that the search results when we accesed portal.domain.aaa were actually pointing to portal.domain.aaa document and pages, but when we switched to the other addresses the absolute links in the page and the search results were still pointing to the portal.domain.aaa address! If we visited a page that was not visited before everything worked ok.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The solution:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;As we did with the &lt;a href="http://blogs.renacimiento.com/eblanco/archive/2010/02/03/moss-cache-in-https-sites.aspx"&gt;http/https cache issue&lt;/a&gt;, we modified the module that implemented the “VaryByCustom” method and added the hostname to the string that this method returns, so every hostname has its own copy of the page in the cache.&lt;/p&gt;  &lt;p&gt;Hope it helps!&lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=Q_jRuk-tIxM:Lpp1Gaa2V-w:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=Q_jRuk-tIxM:Lpp1Gaa2V-w:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=Q_jRuk-tIxM:Lpp1Gaa2V-w:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/eblanco/~4/h9m9FhGEQ58" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Enrique Blanco</dc:creator><pubDate>Wed, 08 Sep 2010 20:47:02 GMT</pubDate><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/MOSS/WSS/default.aspx">MOSS/WSS</category><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/Bugs/default.aspx">Bugs</category><feedburner:origLink>http://blogs.renacimiento.com/eblanco/archive/2010/09/08/moss-cache-with-different-alternate-access-mappings.aspx</feedburner:origLink></item><item><title>Parameterized tests with Pex.</title><link>http://feedproxy.google.com/~r/eblanco/~3/lo0fr-82Nho/parameterized-tests-with-pex-.aspx</link><guid isPermaLink="false">/eblanco/archive/2010/03/28/parameterized-tests-with-pex-.aspx</guid><description>&lt;div class="ExternalClassFD5ACF127DC04AA8A730F0B8243F5FFF"&gt;&lt;p&gt;Until now all we did was letting Pex do the automatic testing, that is letting it look for unwanted-erroneous exceptions in out code, but we did not “instruct” it to check the logic in our code. No we are going to complete some of the tests to check it by the means of using asserts and assumptions.&lt;/p&gt;  &lt;p&gt;First of all, let’s see how Pex generates the tests for this method (you can see that we added the preconditions using Pex for it):&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:32768fb8-c3d8-446d-ac76-98ffba4ef3ca" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:'Courier New', Courier, Monospace;font-size:10pt"&gt; &lt;div style="background:#ddd;overflow:auto"&gt; &lt;ol style="background:#ffffff;margin:0 0 0 2.5em;padding:0 0 0 5px"&gt; &lt;li&gt; &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; MethodToBeTested (&lt;span style="color:#0000ff"&gt;int&lt;/span&gt; i, &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; j) &lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;        {&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#008000"&gt;// &amp;lt;pex&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;if&lt;/span&gt; (j == 0)&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#0000ff"&gt;throw&lt;/span&gt; &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ArgumentException&lt;/span&gt;(&lt;span style="color:#a31515"&gt;&amp;quot;j == 0&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515"&gt;&amp;quot;j&amp;quot;&lt;/span&gt;);&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;if&lt;/span&gt; (i == &lt;span style="color:#0000ff"&gt;int&lt;/span&gt;.MinValue)&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#0000ff"&gt;throw&lt;/span&gt; &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ArgumentException&lt;/span&gt;(&lt;span style="color:#a31515"&gt;&amp;quot;i == int.MinValue&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515"&gt;&amp;quot;i&amp;quot;&lt;/span&gt;);&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            &lt;span style="color:#008000"&gt;// &amp;lt;/pex&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; i / j;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;        }&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;When you write a test like this:&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:7299b299-1977-4e81-901d-ce573ede2f6d" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:'Courier New', Courier, Monospace;font-size:10pt"&gt; &lt;div style="background:#ddd;overflow:auto"&gt; &lt;ol style="background:#ffffff;margin:0 0 0 2.5em;padding:0 0 0 5px"&gt; &lt;li&gt;[&lt;span style="color:#2b91af"&gt;PexMethod&lt;/span&gt;]&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; MethodToBeTested(&lt;/li&gt; &lt;li&gt;    [&lt;span style="color:#2b91af"&gt;PexAssumeUnderTest&lt;/span&gt;]&lt;span style="color:#2b91af"&gt;ClassToBeTested&lt;/span&gt; target,&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; i,&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; j&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;)&lt;/li&gt; &lt;li&gt;{&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    &lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; result = target.MethodToBeTested(i, j);&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt; &lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; result;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    &lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;What you are really writing is some kind of test template, then Pex analyses the code of the method and constructs an input table based on your code, choosing the values of the parameters that can be “interesting”. In the Pex exploration you can see the values it has chosen:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/ParameterizedtestswithPex_FB5C/image_2.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="image" border="0" alt="image" src="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/ParameterizedtestswithPex_FB5C/image_thumb.png" width="644" height="114"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So, once it has the code and the values for the inputs, it generates the actual tests, you can see them in the solution explorer as associated files of the “main” test file, it generates a single file for each [PexMethod] attributed method in the file:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/ParameterizedtestswithPex_FB5C/image_4.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="image" border="0" alt="image" src="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/ParameterizedtestswithPex_FB5C/image_thumb_1.png" width="304" height="122"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So if we open one of this tests you’ll see that the tests generated are standard visual studio tests (if you selected this test framework) and also they feed the methods with the inputs shown in the exploration window. So what we really do when we write a test using Pex is to make a “base test method” that is called with some input values in each of the actual tests:&lt;/p&gt;  &lt;p&gt;   &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:9afb0752-aa34-4dbf-bd93-27d9d99baced" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:'Courier New', Courier, Monospace;font-size:10pt"&gt; &lt;div style="background:#ddd;overflow:auto"&gt; &lt;ol style="background:#ffffff;margin:0 0 0 2.5em;padding:0 0 0 5px"&gt; &lt;li&gt;[&lt;span style="color:#2b91af"&gt;TestMethod&lt;/span&gt;]&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;[&lt;span style="color:#2b91af"&gt;PexGeneratedBy&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af"&gt;ClassToBeTestedTest&lt;/span&gt;))]&lt;/li&gt; &lt;li&gt;[&lt;span style="color:#2b91af"&gt;ExpectedException&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af"&gt;ArgumentException&lt;/span&gt;))]&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; MethodToBeTestedThrowsArgumentException854()&lt;/li&gt; &lt;li&gt;{&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; i;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#2b91af"&gt;ClassToBeTested&lt;/span&gt; s0 = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ClassToBeTested&lt;/span&gt;();&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    i = &lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.MethodToBeTested(s0, 0, 0);&lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;[&lt;span style="color:#2b91af"&gt;TestMethod&lt;/span&gt;]&lt;/li&gt; &lt;li&gt;[&lt;span style="color:#2b91af"&gt;PexGeneratedBy&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af"&gt;ClassToBeTestedTest&lt;/span&gt;))]&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; MethodToBeTested8701()&lt;/li&gt; &lt;li&gt;{&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; i;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#2b91af"&gt;ClassToBeTested&lt;/span&gt; s0 = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ClassToBeTested&lt;/span&gt;();&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    i = &lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.MethodToBeTested(s0, 0, 1);&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#2b91af"&gt;Assert&lt;/span&gt;.AreEqual&amp;lt;&lt;span style="color:#0000ff"&gt;int&lt;/span&gt;&amp;gt;(0, i);&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    &lt;span style="color:#2b91af"&gt;Assert&lt;/span&gt;.IsNotNull((&lt;span style="color:#0000ff"&gt;object&lt;/span&gt;)s0);&lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;[&lt;span style="color:#2b91af"&gt;TestMethod&lt;/span&gt;]&lt;/li&gt; &lt;li&gt;[&lt;span style="color:#2b91af"&gt;PexGeneratedBy&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af"&gt;ClassToBeTestedTest&lt;/span&gt;))]&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;[&lt;span style="color:#2b91af"&gt;ExpectedException&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af"&gt;ArgumentException&lt;/span&gt;))]&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; MethodToBeTestedThrowsArgumentException688()&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; i;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    &lt;span style="color:#2b91af"&gt;ClassToBeTested&lt;/span&gt; s0 = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ClassToBeTested&lt;/span&gt;();&lt;/li&gt; &lt;li&gt;    i = &lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.MethodToBeTested(s0, &lt;span style="color:#0000ff"&gt;int&lt;/span&gt;.MinValue, 1);&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/p&gt;  &lt;p&gt;You can see the that the values match the ones in the exploration window, and also the expected exceptions are checked.&lt;/p&gt;  &lt;p&gt;So the real utility of Pex is that &lt;strong&gt;it automatically checks for problematic values, but from a “dumb” perspective, now we will use assumptions and assertions to check the “business” validity of our code by using parameterized tests&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;To create a parameterized test you can use the option in the menu, or just copy the Pex Method giving it a different name. Once you have the new test method we will feed our method with certain values and then we will check the results.&lt;/p&gt;  &lt;p&gt;No what we will do is to check that when “i” and “j” are positive values, the result of the division should be equal or greater than 0. So we will write this method:&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:fcbb6be1-7b74-4f95-874d-90d18b6ff5c8" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:'Courier New', Courier, Monospace;font-size:10pt"&gt; &lt;div style="background:#ddd;overflow:auto"&gt; &lt;ol style="background:#ffffff;margin:0 0 0 2.5em;padding:0 0 0 5px"&gt; &lt;li&gt;[&lt;span style="color:#2b91af"&gt;PexMethod&lt;/span&gt;]&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;float&lt;/span&gt; MethodToBeTestedAssert(&lt;/li&gt; &lt;li&gt;            [&lt;span style="color:#2b91af"&gt;PexAssumeUnderTest&lt;/span&gt;]&lt;span style="color:#2b91af"&gt;ClassToBeTested&lt;/span&gt; target,&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; i,&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; j&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;        )&lt;/li&gt; &lt;li&gt;        {&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            &lt;span style="color:#2b91af"&gt;PexAssume&lt;/span&gt;.IsTrue(i &amp;gt; 0);&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#2b91af"&gt;PexAssume&lt;/span&gt;.IsTrue(j &amp;gt; 0);&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            &lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; result = target.MethodToBeTested(i, j);&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            &lt;span style="color:#2b91af"&gt;PexAssert&lt;/span&gt;.IsTrue(result&amp;gt;=0);&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; result;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            &lt;/li&gt; &lt;li&gt;        }&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;  &lt;p&gt;You can see we used the &lt;a href="http://research.microsoft.com/en-us/um/redmond/projects/pex/wiki/pexassume.html" target="_blank"&gt;PexAssume&lt;/a&gt; objects, that instructs Pex about the valid values for the inputs, and we check the values using the &lt;a href="http://research.microsoft.com/en-us/um/redmond/projects/pex/wiki/PexAssert.html" target="_blank"&gt;PexAssert&lt;/a&gt; object.&lt;/p&gt;  &lt;p&gt;To generate the code for this new Pex test, you can go to the tested method, right-click it and the select “Run Pex”&lt;/p&gt;  &lt;p&gt;So let’s see how this modifies the Pex generated code:&lt;/p&gt;  &lt;p&gt;First of all you need to select the appropriate test in the Pex exploration window:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/ParameterizedtestswithPex_FB5C/image_6.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="image" border="0" alt="image" src="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/ParameterizedtestswithPex_FB5C/image_thumb_2.png" width="644" height="121"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Then you can see you have less inputs in this test than the ones in the automatic one, this is because you instructed Pex to use only greater that zero values in your inputs by using the PexAssume class. So Pex analyses the preconditions you give it to generate a test set.&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:f4bd8bed-7f43-4927-baaa-0c40cd7cd05b" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:'Courier New', Courier, Monospace;font-size:10pt"&gt; &lt;div style="background:#ddd;overflow:auto"&gt; &lt;ol style="background:#ffffff;margin:0 0 0 2.5em;padding:0 0 0 5px"&gt; &lt;li&gt;[&lt;span style="color:#2b91af"&gt;TestMethod&lt;/span&gt;]&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;[&lt;span style="color:#2b91af"&gt;PexGeneratedBy&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af"&gt;ClassToBeTestedTest&lt;/span&gt;))]&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; MethodToBeTestedAssert868()&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;float&lt;/span&gt; f;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    &lt;span style="color:#2b91af"&gt;ClassToBeTested&lt;/span&gt; s0 = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ClassToBeTested&lt;/span&gt;();&lt;/li&gt; &lt;li&gt;    f = &lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.MethodToBeTestedAssert(s0, 1, 1);&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    &lt;span style="color:#2b91af"&gt;Assert&lt;/span&gt;.AreEqual&amp;lt;&lt;span style="color:#0000ff"&gt;float&lt;/span&gt;&amp;gt;((&lt;span style="color:#0000ff"&gt;float&lt;/span&gt;)1, f);&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#2b91af"&gt;Assert&lt;/span&gt;.IsNotNull((&lt;span style="color:#0000ff"&gt;object&lt;/span&gt;)s0);&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;If you want to specify a custom value for an input parameter you can do two things, use a PexAssume statement or modify the input parameters of the method, for example this method:&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:6bb1758d-d1a5-4da5-9314-9dec25396381" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:'Courier New', Courier, Monospace;font-size:10pt"&gt; &lt;div style="background:#ddd;overflow:auto"&gt; &lt;ol style="background:#ffffff;margin:0 0 0 2.5em;padding:0 0 0 5px"&gt; &lt;li&gt;[&lt;span style="color:#2b91af"&gt;PexMethod&lt;/span&gt;]&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;float&lt;/span&gt; MethodToBeTestedAssert(&lt;/li&gt; &lt;li&gt;            [&lt;span style="color:#2b91af"&gt;PexAssumeUnderTest&lt;/span&gt;]&lt;span style="color:#2b91af"&gt;ClassToBeTested&lt;/span&gt; target,          &lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; j&lt;/li&gt; &lt;li&gt;        )&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;        {&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; i = 12;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            &lt;span style="color:#2b91af"&gt;PexAssume&lt;/span&gt;.IsTrue(j &amp;gt;= 0);&lt;/li&gt; &lt;li&gt; &lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; result = target.MethodToBeTested(i, j);&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#2b91af"&gt;PexAssert&lt;/span&gt;.IsTrue(result &amp;gt;= 0);&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; result;&lt;/li&gt; &lt;li&gt; &lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;        }&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;Which receives only one parameter and assures it is greater or equal to 0, generates these inputs (note that there are no “i” parameter:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/ParameterizedtestswithPex_FB5C/image_8.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="image" border="0" alt="image" src="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/ParameterizedtestswithPex_FB5C/image_thumb_3.png" width="644" height="107"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And the code is this:&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:60c4638a-5882-4071-a4a2-abd7ce12e0e7" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:'Courier New', Courier, Monospace;font-size:10pt"&gt; &lt;div style="background:#ddd;overflow:auto"&gt; &lt;ol style="background:#ffffff;margin:0 0 0 2.5em;padding:0 0 0 5px"&gt; &lt;li&gt;[&lt;span style="color:#2b91af"&gt;TestMethod&lt;/span&gt;]&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;[&lt;span style="color:#2b91af"&gt;PexGeneratedBy&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af"&gt;ClassToBeTestedTest&lt;/span&gt;))]&lt;/li&gt; &lt;li&gt;[&lt;span style="color:#2b91af"&gt;ExpectedException&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af"&gt;ArgumentException&lt;/span&gt;))]&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; MethodToBeTestedAssertThrowsArgumentException325()&lt;/li&gt; &lt;li&gt;{&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;float&lt;/span&gt; f;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#2b91af"&gt;ClassToBeTested&lt;/span&gt; s0 = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ClassToBeTested&lt;/span&gt;();&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    f = &lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.MethodToBeTestedAssert(s0, 0);&lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;[&lt;span style="color:#2b91af"&gt;TestMethod&lt;/span&gt;]&lt;/li&gt; &lt;li&gt;[&lt;span style="color:#2b91af"&gt;PexGeneratedBy&lt;/span&gt;(&lt;span style="color:#0000ff"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af"&gt;ClassToBeTestedTest&lt;/span&gt;))]&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; MethodToBeTestedAssert632()&lt;/li&gt; &lt;li&gt;{&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;float&lt;/span&gt; f;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#2b91af"&gt;ClassToBeTested&lt;/span&gt; s0 = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ClassToBeTested&lt;/span&gt;();&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    f = &lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.MethodToBeTestedAssert(s0, 1);&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#2b91af"&gt;Assert&lt;/span&gt;.AreEqual&amp;lt;&lt;span style="color:#0000ff"&gt;float&lt;/span&gt;&amp;gt;((&lt;span style="color:#0000ff"&gt;float&lt;/span&gt;)12, f);&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    &lt;span style="color:#2b91af"&gt;Assert&lt;/span&gt;.IsNotNull((&lt;span style="color:#0000ff"&gt;object&lt;/span&gt;)s0);&lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=shitjoyjjHs:qKpXvzaGxvw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=shitjoyjjHs:qKpXvzaGxvw:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=shitjoyjjHs:qKpXvzaGxvw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/eblanco/~4/lo0fr-82Nho" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Enrique Blanco</dc:creator><pubDate>Sun, 28 Mar 2010 17:45:22 GMT</pubDate><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/.NET/default.aspx">.NET</category><feedburner:origLink>http://blogs.renacimiento.com/eblanco/archive/2010/03/28/parameterized-tests-with-pex-.aspx</feedburner:origLink></item><item><title>Preconditions with Pex. Enhancing our code</title><link>http://feedproxy.google.com/~r/eblanco/~3/JAfgWzuoIfw/preconditions-with-pex-enhancing-our-code.aspx</link><guid isPermaLink="false">/eblanco/archive/2010/03/20/preconditions-with-pex-enhancing-our-code.aspx</guid><description>&lt;div class="ExternalClassDBBA11E6906846CB9F12C29001A8A154"&gt;&lt;p&gt;One of the advantages that Pex has is that it automatically reviews all the executing paths of the code you type, and so, it helps you in building a better, more defensive code.&lt;/p&gt;  &lt;p&gt;For example, if we do a very simple function like this:&lt;/p&gt;  &lt;p&gt;public int MethodToBeTested(int i, int j)   &lt;br&gt;{    &lt;br&gt;            return i / j;    &lt;br&gt;}&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;When you run Pex you get these three tests:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/PreconditionswithPex.Enhancingourcode_11080/image_2.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="image" border="0" alt="image" src="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/PreconditionswithPex.Enhancingourcode_11080/image_thumb.png" width="644" height="107"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; In the first one Pex detects that if you give “j” a value of zero it will raise a DivideByZero exception. A good practice for coding is that all public methods should check their input parameters for wrong values, so for this exception we will add a precondition.&lt;/p&gt;  &lt;p&gt;So we will right-click over the first test and select “Add Precondition…” option:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/PreconditionswithPex.Enhancingourcode_11080/image_4.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="image" border="0" alt="image" src="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/PreconditionswithPex.Enhancingourcode_11080/image_thumb_1.png" width="644" height="280"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;  &lt;p&gt;You can see in the tooltip the code of the precondition, once we select the option we are presented a dialog where the code is displayed:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/PreconditionswithPex.Enhancingourcode_11080/image_6.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="image" border="0" alt="image" src="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/PreconditionswithPex.Enhancingourcode_11080/image_thumb_2.png" width="598" height="484"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Once we click the “Apply” button, Pex modifies our code to check the values:&lt;/p&gt;  &lt;p&gt;public int MethodToBeTested(int i, int j)   &lt;br&gt;        {    &lt;br&gt;            // &amp;lt;pex&amp;gt;    &lt;br&gt;            if (j == 0)    &lt;br&gt;                throw new ArgumentException(&amp;quot;j == 0&amp;quot;, &amp;quot;j&amp;quot;);    &lt;br&gt;            // &amp;lt;/pex&amp;gt;    &lt;br&gt;            return i / j;    &lt;br&gt;        }&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Then if we run Pex again on our code we can see that the first test is green, because our code checks properly the input parameter:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/PreconditionswithPex.Enhancingourcode_11080/image_8.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="image" border="0" alt="image" src="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/PreconditionswithPex.Enhancingourcode_11080/image_thumb_3.png" width="644" height="148"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;You can do the same for the other wrong test. Hope it helps ;-)&lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=LWAmE0xI83U:Htoy7B8EuC8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=LWAmE0xI83U:Htoy7B8EuC8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=LWAmE0xI83U:Htoy7B8EuC8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/eblanco/~4/JAfgWzuoIfw" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Enrique Blanco</dc:creator><pubDate>Sat, 20 Mar 2010 19:16:17 GMT</pubDate><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/.NET/default.aspx">.NET</category><feedburner:origLink>http://blogs.renacimiento.com/eblanco/archive/2010/03/20/preconditions-with-pex-enhancing-our-code.aspx</feedburner:origLink></item><item><title>Starting with PEX</title><link>http://feedproxy.google.com/~r/eblanco/~3/Z3anA8aTBX4/starting-with-pex.aspx</link><guid isPermaLink="false">/eblanco/archive/2010/03/16/starting-with-pex.aspx</guid><description>&lt;div class="ExternalClassB996D145499D42608611AEF6169E0BD6"&gt;&lt;p&gt; Hi, this means to be the first of a series of posts about &lt;a href="http://research.microsoft.com/en-us/projects/pex/default.aspx" target="_blank"&gt;PEX and Moles&lt;/a&gt;. They conform a test suite intended to make life easier to the developers, they work on both VS2008 and VS2010, Acordding to their site:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;p&gt;&lt;strong&gt;Pex automatically generates test suites with high co&lt;/strong&gt;&lt;strong&gt;de coverage.&lt;/strong&gt; Right from the Visual Studio code editor, Pex finds interesting input-output values of your methods, which you can save as a small test suite with high code coverage. Microsoft Pex is a Visual Studio add-in for testing .NET Framework applications. &lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;p&gt;&lt;strong&gt;Moles allows to replace any .NET method with a delegate.&lt;/strong&gt; Moles supports unit testing by providing isolation by way of detours and stubs. The Moles framework is provided with Pex, or can be installed by itself as a Microsoft Visual Studio add-in.&lt;/p&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So let’s start using Pex in a very very simple way, let’s give some advanced topics for later posts…&lt;/p&gt;  &lt;p&gt;First of all you have to download and install the software from &lt;a href="http://research.microsoft.com/en-us/projects/pex/downloads.aspx" target="_blank"&gt;the download page&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;After installing let’s create a new class library project, and add a class with a simple method, since Pex analyses your code, let’s put some different executions paths, in our function, two or three ifs would be enough.&lt;/p&gt;  &lt;p&gt;Then over the function right click and select “Run Pex”:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/StartingwithPEX_145DB/Pex1_2.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="Pex1" border="0" alt="Pex1" src="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/StartingwithPEX_145DB/Pex1_thumb.png" width="404" height="352"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You can see that the code, depending on the value of the i parameter, throws an exception, adds another parameter or subtracts the parameter values.&lt;/p&gt;  &lt;p&gt;So we click over the “Run Pex” option and Pex asks which test framework are we going to use, so we’ll select the Visual Stuidio test framework:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/StartingwithPEX_145DB/Pex2_2.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="Pex2" border="0" alt="Pex2" src="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/StartingwithPEX_145DB/Pex2_thumb.png" width="516" height="162"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So when you run click OK, it automatically creates some tests for you that take into account the different execution paths of the method being tested.&lt;/p&gt;  &lt;p&gt;You can see it has created three tests and has calculated the expected results for each one, so we will run the tests (the green arrow in the upper of the Pex Exploration Results window):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/StartingwithPEX_145DB/results1_2.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="results1" border="0" alt="results1" src="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/StartingwithPEX_145DB/results1_thumb.png" width="644" height="215"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You will see that the first one (the exception one) is marked red, so we will right click over it and tell Pex to allow that exception in this method with that input so you’ll see a window like this, and click ok:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/StartingwithPEX_145DB/excepcion_2.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="excepcion" border="0" alt="excepcion" src="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/StartingwithPEX_145DB/excepcion_thumb.png" width="516" height="414"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;After applying the changes, Pex has inserted an attribute in the tests it has generated to allow that exception in that specific test, now you can run the tests again:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/StartingwithPEX_145DB/results2_2.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="results2" border="0" alt="results2" src="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/StartingwithPEX_145DB/results2_thumb.png" width="644" height="206"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So far so good, now let’s make some changes to the code, inserting another execution path:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/StartingwithPEX_145DB/codigo2_4.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="codigo2" border="0" alt="codigo2" src="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/StartingwithPEX_145DB/codigo2_thumb_1.png" width="404" height="329"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;To update the tests, simply right click over the code and select “Run Pex”, so the new test for the new execution path will be created (now there are four tests):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/StartingwithPEX_145DB/results3_2.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="results3" border="0" alt="results3" src="http://blogs.renacimiento.com/eblanco/Media/WindowsLiveWriter/StartingwithPEX_145DB/results3_thumb.png" width="644" height="118"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;When first using Pex I came across this error:&lt;/p&gt;  &lt;p&gt;System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Z3, Version=2.0.30325.1, Culture=neutral, PublicKeyToken=9c8d792caae602a2' or one of its dependencies. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail. (Exception from HRESULT: 0x800736B1)&lt;/p&gt;  &lt;p&gt;The solution as &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/pex/thread/5862d522-0c2e-481c-b537-864e7427a7e5" target="_blank"&gt;seen in the forums&lt;/a&gt; was to manually install the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&amp;amp;displaylang=en" target="_blank"&gt;Microsoft Visual C++ 2008 SP1 Redistributable Package&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Enjoy it! More posts on Pex and Moles coming soon!&lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=zCtE7LSgZpo:TjYowG2EgbM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=zCtE7LSgZpo:TjYowG2EgbM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=zCtE7LSgZpo:TjYowG2EgbM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/eblanco/~4/Z3anA8aTBX4" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Enrique Blanco</dc:creator><pubDate>Tue, 16 Mar 2010 23:03:37 GMT</pubDate><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/Arquitectura/default.aspx">Arquitectura</category><feedburner:origLink>http://blogs.renacimiento.com/eblanco/archive/2010/03/16/starting-with-pex.aspx</feedburner:origLink></item><item><title>Tools and Tips for HTML Integration</title><link>http://feedproxy.google.com/~r/eblanco/~3/SK-q9QCeIz0/tools-tips-for-html-integration.aspx</link><guid isPermaLink="false">/eblanco/archive/2010/02/23/tools-tips-for-html-integration.aspx</guid><description>&lt;div class="ExternalClass308EE9ED7E5B4BEFB34B93745D25943C"&gt;
&lt;p&gt;One of our weak points usually is the design integration tasks, if you are lucky you can have a very skilled web designer that gives you a cool cross-browser compatible markup that fits perfectly in your application, but most of the times you’re lucky if the HTML works perfectly in the plain html file and almost never the designer will be able to integrate him/herself the design into an .aspx or moss template, so when you start integrating it with your controls the pain comes.&lt;/p&gt;
&lt;p&gt;In our last Project we needed a IE6+ compatible site, complying with accessibility standards and had to make extensive html changes to fit that, in this post I’ll talk about some of the tools and tips we used to do that:&lt;/p&gt;
&lt;h3&gt;Tools&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038&amp;amp;displaylang=en" target="_blank"&gt;Internet Explorer Developer Toolbar&lt;/a&gt; / &lt;a href="http://getfirebug.com/" target="_blank"&gt;Firebug extension for Firefox&lt;/a&gt; : &lt;strong&gt;A must have&lt;/strong&gt;, I personally prefer Internet Explorer’s developer toolbar, but firebug is also very useful. The main point about IE is a “condensed css view” in which you can see the precedence of the css styles that are applied to a certain element, and it’s very useful to debug. The point here is that when using these you can make quick css changes on the fly without really changing the css in the server, so the adjusting process is really fastened. The IE Developer toolbar is available for all the IE versions, but IE8 version is the best. &lt;/li&gt;
&lt;li&gt;&lt;a href="http://tredosoft.com/Multiple_IE" target="_blank"&gt;MultipleIE&lt;/a&gt; and things so: Designers love things like this, they let them quickly test the design in lots of browser versions but &lt;b&gt;I don’t recommend using those! &lt;/b&gt;The problem is that javascript does not execute properly (for example moving webparts fails) and you can come across really weird problems. My recommendation is to download and use the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&amp;amp;displaylang=en" target="_blank"&gt;Internet Explorer Application Compatibility VPC Images for IE6/IE7/IE8&lt;/a&gt; from MS, a set of virtual machines with different IE versions and developer tools installed.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://expression.microsoft.com/en-us/dd565874.aspx" target="_blank"&gt;Expression Web Superpreview&lt;/a&gt; / &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=8e6ac106-525d-45d0-84db-dccff3fae677&amp;amp;displaylang=en" target="_blank"&gt;Expression Web Superpreview for Internet Explorer&lt;/a&gt;: This is really cool to test it in multiple browsers. You can see the different views side by side and test the differences visually. It is very useful in case you can’t have the virtual machines. The Expresion Web is commercial software, the “for Internet Explorer” version is free, but only supports internet explorer.&lt;/li&gt;
&lt;li&gt;TAW - Test de accesibilidad web (&lt;a href="http://www.tawdis.net/"&gt;http://www.tawdis.net/&lt;/a&gt;): It is the “de facto” standard for accessibility testing in Spain, it can show you many errors and guidelines to make your site accessible.&lt;/li&gt;
&lt;li&gt;Color contrast analyzer (&lt;a href="http://www.paciellogroup.com/resources/contrast-analyser.html#download" target="_blank"&gt;executable&lt;/a&gt;  &amp;amp; &lt;a href="http://juicystudio.com/article/colour-contrast-analyser-firefox-extension.php" target="_blank"&gt;Firefox extension&lt;/a&gt;): A very useful tool to test if your color scheme complies with accessibility standards. Note that the FF version only tests for contrast between background color and text, it does not take into account the images..&lt;/li&gt;
&lt;li&gt;CSS Frameworks: You can use something like &lt;a target="_blank"&gt;blueprint&lt;/a&gt; or &lt;a href="http://960.gs/" target="_blank"&gt;960.gs&lt;/a&gt;, if the designer uses, for example, the 960gs templates when creating the site, you can save a HUGE amount of time in the integration phase. Once you have integrated, you can delete the classes you haven’t used, since it includes way more features than you usually use.&lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;Documentation:&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://www.librosweb.es/"&gt;http://www.librosweb.es/&lt;/a&gt; -&amp;gt; In Spanish, a very good css book.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.w3.org/TR/CSS2/selector.html"&gt;http://www.w3.org/TR/CSS2/selector.html&lt;/a&gt; -&amp;gt; The css selector reference.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms533054(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/ms533054(VS.85).aspx&lt;/a&gt; -&amp;gt; The best (D)HTML reference I’ve found&lt;/li&gt;&lt;/ol&gt;
&lt;h3&gt;Some Automatic tools (untested): &lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://browsershots.org/"&gt;http://browsershots.org/&lt;/a&gt; It tests your site in lots of different browsers and shows you screenshots of the image. Good for fast testing.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.onderhond.com/tools/ie6fixer"&gt;http://www.onderhond.com/tools/ie6fixer&lt;/a&gt;. They claim that they automatically fix your css to work with IE6.&lt;/li&gt;
&lt;li&gt;&lt;a title="http://www.psd2html.com/" href="http://www.psd2html.com/"&gt;http://www.psd2html.com/&lt;/a&gt; It’s not really automatic, you can use it, when, simply said, your designer does not know how to code XHTML properly (so common, so sad :().&lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;Tips:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Use a dual monitor configuration if you can&lt;/strong&gt;. The editor in one screen and the virtual machine/browser in the other, it will save you a lot of time.&lt;/li&gt;
&lt;li&gt;Doctypes: Try to use the XHTML doctype, note: some doctype versions “have a problem” with the target attribute in anchors, use &lt;a href="http://validator.w3.org/"&gt;http://validator.w3.org&lt;/a&gt; to check for the validity of the markup.&lt;/li&gt;
&lt;li&gt;Use the metatags for ie8 compatibility modes if necessary: &lt;a href="http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Use some reset css (for example: &lt;a href="http://meyerweb.com/eric/tools/css/reset/"&gt;http://meyerweb.com/eric/tools/css/reset/&lt;/a&gt; ): Different browsers assign different values to default tags, for example default padding, margin or font size, then when you try to integrate things do not fit exactly. &lt;/li&gt;
&lt;li&gt;Use em for font sizes. Declare a font-size in your body for example a “75%”. And make all fonts relative to that size, so resizing the fonts in your page can be done by simply modifying that value.&lt;/li&gt;
&lt;li&gt;Distribute your css files in a logical manner: Don’t use a single one, I used a reset, another for the grid layout, another for the main things, one specific for IE7 hacks and another for IE6 hacks  My favorite would be to use only three: One that comprehends reset, grid layout and the main-standard things, one for the hacks for ie7 &amp;amp; one for ie6. IE8 is quite standard, so if you need a hack for it, try rethinking the way you’re doing that, and I’m sure that you will find a more css that works on IE, FF and Chrome. &lt;strong&gt;Seriously.&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=U5sEU9IoJzY:sBhP0aiRVkg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=U5sEU9IoJzY:sBhP0aiRVkg:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=U5sEU9IoJzY:sBhP0aiRVkg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/eblanco/~4/SK-q9QCeIz0" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Enrique Blanco</dc:creator><pubDate>Tue, 23 Feb 2010 22:16:00 GMT</pubDate><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/Internet/default.aspx">Internet</category><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/Proyectos/default.aspx">Proyectos</category><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/User Experience/default.aspx">User Experience</category><feedburner:origLink>http://blogs.renacimiento.com/eblanco/archive/2010/02/23/tools-tips-for-html-integration.aspx</feedburner:origLink></item><item><title>Disabling input validation in MVC2 using ASP.NET 4.0 (Part II)</title><link>http://feedproxy.google.com/~r/eblanco/~3/V2sERRLdldQ/disabling-input-validation-in-mvc2-using-asp-net-4-0-part-ii.aspx</link><guid isPermaLink="false">/eblanco/archive/2010/02/21/disabling-input-validation-in-mvc2-using-asp-net-4-0-part-ii.aspx</guid><description>&lt;div class="ExternalClass3787742AF1FB434BAED65C6FFFB58EB9"&gt;&lt;p&gt;This is the second part of “&lt;a title="Enrique Blanco - Disabling input validation in MVC2 using ASP.NET 4.0" href="http://blogs.renacimiento.com/eblanco/archive/2010/02/08/disabling-input-validation-in-mvc2-using-asp-net-4-0.aspx"&gt;Disabling input validation in MVC2 using ASP.NET 4.0&lt;/a&gt;”, in the first part we saw how to disable the input validation, to upload, for example, html code.&lt;/p&gt;  &lt;p&gt;The problem with that is that we disabled the validation for all fields in the form, so all the other fields (that might not contain html) can be “hacked” with html code if you don’t notice.&lt;/p&gt;  &lt;p&gt;So we need to protect them, and to be consistent with the rest of your application, let’s use the validation provide for ASP.NET by default.&lt;/p&gt;  &lt;p&gt;If you use .NET Reflector, you’ll see that the input validation in ASP.NET 4.0 is done by the RequestValidator class, and by the protected “IsValidRequestString” Method, so we’ll create an inherited class called “CustomRequestValidator”:&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:df897530-4ec8-4896-85d0-cc3fc7ea0292" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:'Courier New', Courier, Monospace;font-size:10pt"&gt; &lt;div style="background:#ddd;overflow:auto"&gt; &lt;ol style="background:#ffffff;margin:0 0 0 2.5em;padding:0 0 0 5px"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;internal&lt;/span&gt; &lt;span style="color:#0000ff"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomRequestValidator&lt;/span&gt; : System.Web.Util.RequestValidator&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    {&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;        &lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; Validates a form parameter&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;        &lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;param name=&amp;quot;formParameter&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style="color:#008000"&gt;The name of the parameter&lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;bool&lt;/span&gt; IsValidFormParameter(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; formParameter)&lt;/li&gt; &lt;li&gt;        {&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; fieldValue = HttpContext.Current.Request.Form[formParameter];&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; validationFailureIndex = 0;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff"&gt;base&lt;/span&gt;.IsValidRequestString(HttpContext.Current, fieldValue,&lt;/li&gt; &lt;li&gt;                System.Web.Util.RequestValidationSource.Form, formParameter,&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;                &lt;span style="color:#0000ff"&gt;out&lt;/span&gt; validationFailureIndex);&lt;/li&gt; &lt;li&gt;        }&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt; &lt;/li&gt; &lt;li&gt;        &lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;        &lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; Validates a querystring parameter&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;        &lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;param name=&amp;quot;formParameter&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style="color:#008000"&gt;The name of the parameter&lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;bool&lt;/span&gt; IsValidQueryStringParameter(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; formParameter)&lt;/li&gt; &lt;li&gt;        {&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; fieldValue = HttpContext.Current.Request.QueryString[formParameter];&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; validationFailureIndex = 0;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff"&gt;base&lt;/span&gt;.IsValidRequestString(HttpContext.Current, fieldValue,&lt;/li&gt; &lt;li&gt;                System.Web.Util.RequestValidationSource.QueryString, formParameter,&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;                &lt;span style="color:#0000ff"&gt;out&lt;/span&gt; validationFailureIndex);&lt;/li&gt; &lt;li&gt;        }&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    }&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;As you can see we created two methods, one to validate form parameters and another to validate querystring ones.&lt;/p&gt;  &lt;p&gt;So in our controller we just need to insert a code like this, to validate all parameters but the “html-ed” one:&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:561be226-e174-4290-a9af-2958ce264d0f" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:'Courier New', Courier, Monospace;font-size:10pt"&gt; &lt;div style="background:#ddd;overflow:auto"&gt; &lt;ol style="background:#ffffff;margin:0 0 0 2.5em;padding:0 0 0 5px"&gt; &lt;li&gt;&lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;        &lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; Validates form input&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; CustomValidateRequest()&lt;/li&gt; &lt;li&gt;        {&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; campoHtml = &lt;span style="color:#a31515"&gt;&amp;quot;Description&amp;quot;&lt;/span&gt;;&lt;/li&gt; &lt;li&gt; &lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            WandauRequestValidator reqVal = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; WandauRequestValidator();&lt;/li&gt; &lt;li&gt;            NameValueCollection nvCol = HttpContext.Request.Form;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;foreach&lt;/span&gt; (&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; key &lt;span style="color:#0000ff"&gt;in&lt;/span&gt; nvCol.AllKeys)&lt;/li&gt; &lt;li&gt;            {&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;                &lt;span style="color:#0000ff"&gt;if&lt;/span&gt; (!&lt;span style="color:#2b91af"&gt;String&lt;/span&gt;.Equals(campoHtml, key, &lt;span style="color:#2b91af"&gt;StringComparison&lt;/span&gt;.InvariantCultureIgnoreCase) &amp;amp;&amp;amp;&lt;/li&gt; &lt;li&gt;                    !reqVal.IsValidFormParameter(key))&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;                {&lt;/li&gt; &lt;li&gt;                    ModelState.AddModelError(key, &lt;span style="color:#a31515"&gt;&amp;quot;The field has invalid chars&amp;quot;&lt;/span&gt;);&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;                }                &lt;/li&gt; &lt;li&gt;            }&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;        }&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;Note that the html-ed parameter is description and when we find an invalid input we add a model error instead of throwing an exception, so the page validation can alert the user of the misuse of the field.&lt;/p&gt;  &lt;p&gt;Hope it helps!&lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=OaYwt1gzXf4:J6phGMU9gBc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=OaYwt1gzXf4:J6phGMU9gBc:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/eblanco?a=OaYwt1gzXf4:J6phGMU9gBc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/eblanco?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/eblanco/~4/V2sERRLdldQ" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Enrique Blanco</dc:creator><pubDate>Sun, 21 Feb 2010 20:14:42 GMT</pubDate><category domain="http://blogs.renacimiento.com/eblanco/archive/tags/.NET/default.aspx">.NET</category><feedburner:origLink>http://blogs.renacimiento.com/eblanco/archive/2010/02/21/disabling-input-validation-in-mvc2-using-asp-net-4-0-part-ii.aspx</feedburner:origLink></item></channel></rss>

