<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/css" href="http://www.sm-art.biz/Data/style/rss1.css" ?> <?xml-stylesheet type="text/xsl" href="http://www.sm-art.biz/Data/xsl/rss1.xsl" ?>
<!--RSS generated by mojoPortal Blog Module V 1.0 on Saturday, February 04, 2012-->
<rss version="2.0">
  <channel>
    <title>Bloggin'bout Ivonna</title>
    <link>http://www.sm-art.biz/Ivonna/Blog.aspx</link>
    <description>Tutorials and how-tos for Asp.Net automated testing</description>
    <copyright>Copyright 2008 by me</copyright>
    <ttl>120</ttl>
    <managingEditor>art@nospamsm-art.biz</managingEditor>
    <generator>mojoPortal Blog Module V 1.0</generator>
    <item>
      <title>Ivonna 2.1.7 is out!</title>
      <link>http://www.sm-art.biz/ivonna-217-is-out.aspx</link>
      <pubDate>Thu, 12 May 2011 14:26:42 GMT</pubDate>
      <guid>http://www.sm-art.biz/ivonna-217-is-out.aspx</guid>
      <comments>http://www.sm-art.biz/ivonna-217-is-out.aspx</comments>
      <description><![CDATA[<p>Finally I decided to release another, well, release in the 2.* series. This one is not only to restore the latest Isolator compatibility (which, by the way, fixes an annoying issue that prevented Ivonna from running with &gt;net 4.0 sites), it introduces two methods (session.Get and session.Post) for MVC testing (really just simplification of existing functionality), and also session.Stub for simplifying stubbing dependencies in your tests. In short, these are not adding a significant piece of functionality, but rather something worth putting on the homepage as code examples.</p>&nbsp;&nbsp;<a href='http://www.sm-art.biz/ivonna-217-is-out.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>Using AssemblyFixtureAttribute with Ivonna</title>
      <link>http://www.sm-art.biz/using-assemblyfixtureattribute-with-ivonna.aspx</link>
      <pubDate>Thu, 19 Aug 2010 13:18:16 GMT</pubDate>
      <guid>http://www.sm-art.biz/using-assemblyfixtureattribute-with-ivonna.aspx</guid>
      <comments>http://www.sm-art.biz/using-assemblyfixtureattribute-with-ivonna.aspx</comments>
      <description><![CDATA[<p>Typically, you want to run some initialization code for all your tests. Something similar to your <span style="color: rgb(223, 223, 191);">Application_Start()</span> method, e.g., building up NHibernate's SessionFactory, AutoMapper mappings etc. While most of it is still done in the<span style="color: rgb(223, 223, 191);"> Application_Start()</span> method, you might want to do things differently. For example, you might need your configuration before the first Web request, or you might want to use a different database for automated testing.</p>
<p>In MbUnit, you can add a class and decorate it with the AssemblyFixtureAttribute, and the FixtureSetup decorated method will be run once before all tests. Remember, however, that if you want to use it with Ivonna tests, you should decorate the class with RunOnWebAttribute, just like a regular test class.</p>&nbsp;&nbsp;<a href='http://www.sm-art.biz/using-assemblyfixtureattribute-with-ivonna.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>Ivonna 2.1.5 is out</title>
      <link>http://www.sm-art.biz/Blog/ViewPost.aspx?pageid=9&amp;ItemID=28&amp;mid=8</link>
      <pubDate>Mon, 05 Jul 2010 11:34:34 GMT</pubDate>
      <guid>http://www.sm-art.biz/Blog/ViewPost.aspx?pageid=9&amp;ItemID=28&amp;mid=8</guid>
      <comments>http://www.sm-art.biz/Blog/ViewPost.aspx?pageid=9&amp;ItemID=28&amp;mid=8</comments>
      <description><![CDATA[<p>Just uploaded the new 2.1.5 release, grab it <a href="http://sm-art.biz/Ivonna/Download.aspx">here</a>. Nothing new this time, just to make it compatible with the TypeMock Isolator 6.0.4.</p>
<p>All active development is currently done on the 3.0 branch, which is going to be more MVC-oriented (and let you extend it if you prefer other frameworks like Monorail, or <a href="http://fubumvc.com/">FubuMVC</a>, or <a href="http://www.openrasta.com/">Open Rasta</a>). So, if you have a suggestion, just comment on this post, or use <a href="http://sm-art.biz/ForumView.aspx?ItemID=2&amp;mid=5&amp;pageid=7">the forum</a>.</p>&nbsp;&nbsp;<a href='http://www.sm-art.biz/Blog/ViewPost.aspx?pageid=9&ItemID=28&mid=8'>...</a>]]></description>
    </item>
    <item>
      <title>Using #Ivonna and #CThru for testing Asp.Net MVC Views, part 2</title>
      <link>http://www.sm-art.biz/using-ivonna-and-cthru-for-testing-aspnet-mvc-views-part-2.aspx</link>
      <pubDate>Sat, 26 Jun 2010 14:05:00 GMT</pubDate>
      <guid>http://www.sm-art.biz/using-ivonna-and-cthru-for-testing-aspnet-mvc-views-part-2.aspx</guid>
      <comments>http://www.sm-art.biz/using-ivonna-and-cthru-for-testing-aspnet-mvc-views-part-2.aspx</comments>
      <description><![CDATA[<p>Well I finally got back to continue my ideas on <a href="http://sm-art.biz/BlogView.aspx?pageid=9&amp;ItemID=23&amp;mid=8">using Ivonna to test MVC sites</a>. This time I need to make sure that the authenticated user should see the list of her.. whatever. I won't bother you with much code this time (it's not that different from <a href="http://sm-art.biz/BlogView.aspx?pageid=9&amp;ItemID=23&amp;mid=8">the previous part</a>), instead, I'd like to return to the fundamental question of &quot;How do I test this&quot;.</p>
<p>My first idea was, I've got something like a WebForms UserControl here, so I'd go for a RenderAction call. So, in my test I'll make sure that this method is called with proper parameters. If you're smarter than that, you can see that I'm tying my test to the implementation. Instead of &quot;what&quot;, I'm testing &quot;how&quot;. Should I change my implementation to calling RenderPartial or DisplayFor, my test breaks, although I still have my implementation done correctly.</p>
<p>To get it &quot;right&quot; (and you can guess there's no absolutely right way here), I think about what it means, &quot;display a list of thingies&quot;. My guess is that it means two things, data and view, put together and displayed as part of the page. Now, getting the correct data is not the concern of this test (you should write a unit test here), but getting the correct partial View is the job for Ivonna. And after a quick Reflector session (or, better, using the built-in TraceAspect from CThru), we realize that all various implementations ultimately go through IViewEngine.FindPartialView. And all we have to do is spy on these calls, collect the arguments, and make sure that there's been a call to this method with a correct argument (that is, the path to your partial). This way, unless you move or rename the partial, the test stays green even if your implementation changes.</p>
<p>This CThru aspect can be useful in many other scenarios, so I'm going to include it in the next version of <a href="http://sm-art.biz/Ivonna.aspx">Ivonna</a>, which will contain lots of other MVC related features.</p>&nbsp;&nbsp;<a href='http://www.sm-art.biz/using-ivonna-and-cthru-for-testing-aspnet-mvc-views-part-2.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>Ivonna 2.1.4 is out</title>
      <link>http://www.sm-art.biz/Blog/ViewPost.aspx?pageid=9&amp;ItemID=26&amp;mid=8</link>
      <pubDate>Thu, 17 Jun 2010 06:38:02 GMT</pubDate>
      <guid>http://www.sm-art.biz/Blog/ViewPost.aspx?pageid=9&amp;ItemID=26&amp;mid=8</guid>
      <comments>http://www.sm-art.biz/Blog/ViewPost.aspx?pageid=9&amp;ItemID=26&amp;mid=8</comments>
      <description><![CDATA[<p>This is a fix for the bug reported <a href="http://www.typemock.com/community/viewtopic.php?t=1895">here</a>. Go <a href="http://sm-art.biz/Ivonna/Download.aspx">get it</a>. Includes a new version of CThru.</p>&nbsp;&nbsp;<a href='http://www.sm-art.biz/Blog/ViewPost.aspx?pageid=9&ItemID=26&mid=8'>...</a>]]></description>
    </item>
    <item>
      <title>Ivonna 2.1.2 is out</title>
      <link>http://www.sm-art.biz/Blog/ViewPost.aspx?pageid=9&amp;ItemID=25&amp;mid=8</link>
      <pubDate>Sat, 24 Apr 2010 14:20:10 GMT</pubDate>
      <guid>http://www.sm-art.biz/Blog/ViewPost.aspx?pageid=9&amp;ItemID=25&amp;mid=8</guid>
      <comments>http://www.sm-art.biz/Blog/ViewPost.aspx?pageid=9&amp;ItemID=25&amp;mid=8</comments>
      <description><![CDATA[<p>I decided to postpone the new MVC related features to the next release, and just release the fix to the ASP.Net 4.0 issue mentioned in my previous post. The only other improvement is that the 400 Server Error thing is gone, and now we have a more informative exception here.</p>&nbsp;&nbsp;<a href='http://www.sm-art.biz/Blog/ViewPost.aspx?pageid=9&ItemID=25&mid=8'>...</a>]]></description>
    </item>
    <item>
      <title>Ivonna and .Net 4.0</title>
      <link>http://www.sm-art.biz/ivonna-and-net-40.aspx</link>
      <pubDate>Fri, 23 Apr 2010 07:02:33 GMT</pubDate>
      <guid>http://www.sm-art.biz/ivonna-and-net-40.aspx</guid>
      <comments>http://www.sm-art.biz/ivonna-and-net-40.aspx</comments>
      <description><![CDATA[<p>Due to some changes in .Net 4.0, your existing tests will probably break. What's worse, they're breaking with the uninformative &quot;400 Server unavailable&quot; message. A quick fix would be to use absolute paths in your tests, e.g., instead of &quot;Default.aspx&quot; you use &quot;/Default.aspx&quot;.</p>
<p>This exception usually happens when the Asp.Net engine cannot create an instance of an HttpContext. However, the inner exception is not provided (who needs it anyway?), so you're left in the dark. In this case, the actual exception happens inside the HttpRequest.ClientFilePath property getter. It now allows only absolute paths for some reason.</p>
<p>The fix is going to be released at some point next week.</p>&nbsp;&nbsp;<a href='http://www.sm-art.biz/ivonna-and-net-40.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>Using Ivonna and CThru for testing Asp.Net MVC Views, part 1</title>
      <link>http://www.sm-art.biz/Blog/ViewPost.aspx?pageid=9&amp;ItemID=23&amp;mid=8</link>
      <pubDate>Sun, 28 Mar 2010 17:15:24 GMT</pubDate>
      <guid>http://www.sm-art.biz/Blog/ViewPost.aspx?pageid=9&amp;ItemID=23&amp;mid=8</guid>
      <comments>http://www.sm-art.biz/Blog/ViewPost.aspx?pageid=9&amp;ItemID=23&amp;mid=8</comments>
      <description><![CDATA[<a href="http://www.codeproject.com/script/Articles/BlogFeedList.aspx?amid=646967" rel="tag" style="display:none;">CodeProject</a>
<p>Wait, isn't MVC testable by design? Yes, most of it <b>is</b> testable, but as for the Views, you have to resort to integration tests (which isn't bad by itself, but sometimes is not enough).</p>
<p>In my recent project, I needed to write a test verifying that if a user is not authenticated, she should see a login form and a registration form. Speaking in terms of implementation, this means that Html.RenderPartial should be invoked with paths to my partial views containing these forms. Looks like a good task for TypeMock Isolator, but I prefer working with CThru. Here's the test code (forgive me for not following the strict rules, such as one assert per test, this is just for clarity):</p>
<div style="font-family: Courier New; font-size: 8pt; color: rgb(220, 220, 204); background: none repeat scroll 0% 0% rgb(63, 63, 63);">
<pre style="margin: 0px;"><span style="color: rgb(234, 234, 172); font-weight: bold;">Imports</span> <span style="color: rgb(223, 223, 191);">WebTests</span>.<span style="color: rgb(223, 223, 191);">Infrastructure</span></pre>
<pre style="margin: 0px;"><span style="color: rgb(234, 234, 172); font-weight: bold;">Imports</span> <span style="color: rgb(223, 223, 191);">Ivonna</span>.<span style="color: rgb(223, 223, 191);">Framework</span></pre>
<pre style="margin: 0px;"><span style="color: rgb(234, 234, 172); font-weight: bold;">Imports</span> <span style="color: rgb(223, 223, 191);">MbUnit</span>.<span style="color: rgb(223, 223, 191);">Framework</span></pre>
<pre style="margin: 0px;">
&nbsp;</pre>
<pre style="margin: 0px;"><span style="color: rgb(234, 234, 172); font-weight: bold;">Namespace</span> <span style="color: rgb(223, 223, 191);">Membership</span></pre>
<pre style="margin: 0px;">
&nbsp;&nbsp;&nbsp; &lt;<span style="color: rgb(223, 223, 191);">TestFixture</span>(), <span style="color: rgb(223, 223, 191);">RunOnWeb</span>()&gt; _</pre>
<pre style="margin: 0px;">
&nbsp;&nbsp;&nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">Public</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">Class</span> <span style="color: rgb(223, 223, 191);">OwnersPage_NotLoggedIn</span></pre>
<pre style="margin: 0px;">
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;<span style="color: rgb(223, 223, 191);">Test</span>()&gt; _</pre>
<pre style="margin: 0px;">
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">Public</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">Sub</span> <span style="color: rgb(223, 223, 191);">ContainsLoginPartial</span>()</pre>
<pre style="margin: 0px;">
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(127, 159, 127);">'Arrange</span></pre>
<pre style="margin: 0px;">
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">Dim</span> <span style="color: rgb(223, 223, 191);">spy</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">As</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">New</span> <span style="color: rgb(223, 223, 191);">RenderPartialSpy</span></pre>
<pre style="margin: 0px;">
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(223, 223, 191);">CThru</span>.<span style="color: rgb(223, 223, 191);">CThruEngine</span>.<span style="color: rgb(223, 223, 191);">AddAspect</span>(<span style="color: rgb(223, 223, 191);">spy</span>)</pre>
<pre style="margin: 0px;">
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">Dim</span> <span style="color: rgb(223, 223, 191);">session</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">As</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">New</span> <span style="color: rgb(223, 223, 191);">TestSession</span></pre>
<pre style="margin: 0px;">
&nbsp;</pre>
<pre style="margin: 0px;">
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(127, 159, 127);">'Act</span></pre>
<pre style="margin: 0px;">
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(223, 223, 191);">session</span>.<span style="color: rgb(223, 223, 191);">ProcessRequest</span>(<span style="color: rgb(234, 234, 172); font-weight: bold;">New</span> <span style="color: rgb(223, 223, 191);">WebRequest</span>(<span style="color: rgb(200, 145, 145);">&quot;Owners&quot;</span>))</pre>
<pre style="margin: 0px;">
&nbsp;</pre>
<pre style="margin: 0px;">
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(127, 159, 127);">'Assert</span></pre>
<pre style="margin: 0px;">
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(223, 223, 191);">Assert</span>.<span style="color: rgb(223, 223, 191);">Contains</span>(<span style="color: rgb(223, 223, 191);">spy</span>.<span style="color: rgb(223, 223, 191);">ViewNames</span>, <span style="color: rgb(200, 145, 145);">&quot;~/Views/Account/Login.ascx&quot;</span>)</pre>
<pre style="margin: 0px;">
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(223, 223, 191);">Assert</span>.<span style="color: rgb(223, 223, 191);">Contains</span>(<span style="color: rgb(223, 223, 191);">spy</span>.<span style="color: rgb(223, 223, 191);">ViewNames</span>, <span style="color: rgb(200, 145, 145);">&quot;~/Views/Account/Register.ascx&quot;</span>)</pre>
<pre style="margin: 0px;">
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">End</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">Sub</span></pre>
<pre style="margin: 0px;">
&nbsp;&nbsp;&nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">End</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">Class</span></pre>
<pre style="margin: 0px;"><span style="color: rgb(234, 234, 172); font-weight: bold;">End</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">Namespace</span></pre>
</div>
<p>The RenderPartialSpy class can be reused (this is why I prefer CThru), here's the code for it:</p>
<div style="font-family: Courier New; font-size: 8pt; color: rgb(220, 220, 204); background: none repeat scroll 0% 0% rgb(63, 63, 63);">
<pre style="margin: 0px;">
&nbsp;</pre>
<pre style="margin: 0px;"><span style="color: rgb(234, 234, 172); font-weight: bold;">Imports</span> <span style="color: rgb(223, 223, 191);">CThru</span></pre>
<pre style="margin: 0px;"><span style="color: rgb(234, 234, 172); font-weight: bold;">Imports</span> <span style="color: rgb(223, 223, 191);">System</span>.<span style="color: rgb(223, 223, 191);">Web</span>.<span style="color: rgb(223, 223, 191);">Mvc</span>.<span style="color: rgb(223, 223, 191);">Html</span></pre>
<pre style="margin: 0px;">
&nbsp;</pre>
<pre style="margin: 0px;"><span style="color: rgb(234, 234, 172); font-weight: bold;">Namespace</span> <span style="color: rgb(223, 223, 191);">Infrastructure</span></pre>
<pre style="margin: 0px;">
&nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">Public</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">Class</span> <span style="color: rgb(223, 223, 191);">RenderPartialSpy</span></pre>
<pre style="margin: 0px;">
&nbsp; &nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">Inherits</span> <span style="color: rgb(223, 223, 191);">Aspect</span></pre>
<pre style="margin: 0px;">
&nbsp;</pre>
<pre style="margin: 0px;">
&nbsp;</pre>
<pre style="margin: 0px;">
&nbsp; &nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">Public</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">Overrides</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">Function</span> <span style="color: rgb(223, 223, 191);">ShouldIntercept</span>(<span style="color: rgb(234, 234, 172); font-weight: bold;">ByVal</span> <span style="color: rgb(223, 223, 191);">info</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">As</span> <span style="color: rgb(223, 223, 191);">CThru</span>.<span style="color: rgb(223, 223, 191);">InterceptInfo</span>) <span style="color: rgb(234, 234, 172); font-weight: bold;">As</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">Boolean</span></pre>
<pre style="margin: 0px;">
&nbsp; &nbsp; &nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">Return</span> <span style="color: rgb(223, 223, 191);">info</span>.<span style="color: rgb(223, 223, 191);">TypeName</span>.<span style="color: rgb(223, 223, 191);">Contains</span>(<span style="color: rgb(234, 234, 172); font-weight: bold;">&quot;</span><span style="color: rgb(223, 223, 191);">RenderPartialExtensions</span>&quot;) <span style="color: rgb(234, 234, 172); font-weight: bold;">AndAlso</span> <span style="color: rgb(223, 223, 191);">info</span>.<span style="color: rgb(223, 223, 191);">MethodName</span> = <span style="color: rgb(200, 145, 145);">&quot;RenderPartial&quot;</span></pre>
<pre style="margin: 0px;">
&nbsp; &nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">End</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">Function</span></pre>
<pre style="margin: 0px;">
&nbsp;</pre>
<pre style="margin: 0px;">
&nbsp;</pre>
<pre style="margin: 0px;">
&nbsp; &nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">Private</span> <span style="color: rgb(223, 223, 191);">_viewNames</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">As</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">New</span> <span style="color: rgb(223, 223, 191);">List</span>(<span style="color: rgb(234, 234, 172); font-weight: bold;">Of</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">String</span>)</pre>
<pre style="margin: 0px;">
&nbsp; &nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">Public</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">ReadOnly</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">Property</span> <span style="color: rgb(223, 223, 191);">ViewNames</span>() <span style="color: rgb(234, 234, 172); font-weight: bold;">As</span> <span style="color: rgb(223, 223, 191);">IList</span>(<span style="color: rgb(234, 234, 172); font-weight: bold;">Of</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">String</span>)</pre>
<pre style="margin: 0px;">
&nbsp; &nbsp; &nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">Get</span></pre>
<pre style="margin: 0px;">
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">Return</span> <span style="color: rgb(223, 223, 191);">_viewNames</span></pre>
<pre style="margin: 0px;">
&nbsp; &nbsp; &nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">End</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">Get</span></pre>
<pre style="margin: 0px;">
&nbsp; &nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">End</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">Property</span></pre>
<pre style="margin: 0px;">
&nbsp;</pre>
<pre style="margin: 0px;">
&nbsp; &nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">Public</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">Overrides</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">Sub</span> <span style="color: rgb(223, 223, 191);">MethodBehavior</span>(<span style="color: rgb(234, 234, 172); font-weight: bold;">ByVal</span> <span style="color: rgb(223, 223, 191);">e</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">As</span> <span style="color: rgb(223, 223, 191);">CThru</span>.<span style="color: rgb(223, 223, 191);">DuringCallbackEventArgs</span>)</pre>
<pre style="margin: 0px;">
&nbsp; &nbsp; &nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">Me</span>.<span style="color: rgb(223, 223, 191);">ViewNames</span>.<span style="color: rgb(223, 223, 191);">Add</span>(<span style="color: rgb(223, 223, 191);">e</span>.<span style="color: rgb(223, 223, 191);">ParameterValues</span>(<span style="color: rgb(138, 204, 207);">1</span>))</pre>
<pre style="margin: 0px;">
&nbsp; &nbsp; &nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">MyBase</span>.<span style="color: rgb(223, 223, 191);">MethodBehavior</span>(<span style="color: rgb(223, 223, 191);">e</span>)</pre>
<pre style="margin: 0px;">
&nbsp; &nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">End</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">Sub</span></pre>
<pre style="margin: 0px;">
&nbsp;</pre>
<pre style="margin: 0px;">
&nbsp; <span style="color: rgb(234, 234, 172); font-weight: bold;">End</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">Class</span></pre>
<pre style="margin: 0px;"><span style="color: rgb(234, 234, 172); font-weight: bold;">End</span> <span style="color: rgb(234, 234, 172); font-weight: bold;">Namespace</span></pre>
</div>
<p>Here I just set it to intercept all calls on the RenderPartialExtensions class with the method name &quot;RenderPartial&quot;. When the call is intercepted, I save the value of the second argument (remember this is an extension method) in my list. At the Assert stage, I'll be able to retrieve all saved values and check them.</p>&nbsp;&nbsp;<a href='http://www.sm-art.biz/Blog/ViewPost.aspx?pageid=9&ItemID=23&mid=8'>...</a>]]></description>
    </item>
    <item>
      <title>Ivonna 2.1 is out</title>
      <link>http://www.sm-art.biz/ivonna-21-is-out.aspx</link>
      <pubDate>Sun, 21 Feb 2010 13:48:33 GMT</pubDate>
      <guid>http://www.sm-art.biz/ivonna-21-is-out.aspx</guid>
      <comments>http://www.sm-art.biz/ivonna-21-is-out.aspx</comments>
      <description><![CDATA[<p>Much much later than promised, but finally the 2.1 is out.</p>
<p>The focus of this release is on AJAX support. While Ivonna still doesn't deal with client side stuff, you can now fake an AJAX request and test the server's response.</p>
<p>Let's see the code:</p>
<div style="font-family: Courier New; font-size: 10pt; color: rgb(220, 220, 204); background: none repeat scroll 0% 0% rgb(63, 63, 63);">
<pre style="margin: 0px;"><span style="font-size: smaller;"><span style="color: rgb(234, 234, 172); font-weight: bold;">var</span> <span style="color: rgb(223, 223, 191);">session</span> = <span style="color: rgb(234, 234, 172); font-weight: bold;">new</span> <span style="color: rgb(240, 223, 175);">TestSession</span>();</span></pre>
<pre style="margin: 0px;"><span style="font-size: smaller;"><span style="color: rgb(234, 234, 172); font-weight: bold;">var</span> <span style="color: rgb(223, 223, 191);">result</span> = <br /><span style="color: rgb(223, 223, 191);">      session</span>.<span style="color: rgb(223, 223, 191);">ExecuteAjaxMethod</span>(<br />           <span style="color: rgb(200, 145, 145);">&quot;Page.aspx&quot;</span>,<br />            <span style="color: rgb(200, 145, 145);">&quot;MethodName&quot;</span>,<br />           <span style="color: rgb(234, 234, 172); font-weight: bold;"> new</span> {<span style="color: rgb(223, 223, 191);">name</span>=<span style="color: rgb(200, 145, 145);">&quot;John&quot;</span>});</span></pre>
<pre style="margin: 0px;"><span style="font-size: smaller;"><span style="color: rgb(240, 223, 175);">Assert</span>.<span style="color: rgb(223, 223, 191);">AreEqual</span>(<span style="color: rgb(200, 145, 145);">&quot;Hi John!&quot;</span>, <span style="color: rgb(223, 223, 191);">result</span>);</span></pre>
</div>
<p>Note that I'm using an anonymous class object to pass the arguments.</p>
<p>The code above would work with JSON-formatted Web services as well (note that you wouldn't use SOAP formatted services with AJAX anyway). If you need to return a custom object, you can use a generic overload of the same method.</p>
<p>There's also another, simpler alternative for doing AJAX: UpdatePanel. While most serious developers frown upon it, it remains a nice option for doing it quick (and dirty) if the performance and traffic is not an issue. While there's not much you can test with it, Ivonna provides a way to execute a request coming from inside an UpdatePanel:</p>
<div style="font-family: Courier New; font-size: 8pt; color: rgb(220, 220, 204); background: none repeat scroll 0% 0% rgb(63, 63, 63);">
<pre style="margin: 0px;"><span style="color: rgb(234, 234, 172); font-weight: bold;">var</span> <span style="color: rgb(223, 223, 191);">session</span> = <span style="color: rgb(234, 234, 172); font-weight: bold;">new</span> <span style="color: rgb(240, 223, 175);">TestSession</span>();</pre>
<pre style="margin: 0px;"><span style="color: rgb(223, 223, 191);">session</span>.<span style="color: rgb(223, 223, 191);">GetPage</span>(<span style="color: rgb(200, 145, 145);">&quot;HasUpdatePanel.aspx&quot;</span>);</pre>
<pre style="margin: 0px;"><span style="color: rgb(234, 234, 172); font-weight: bold;">var</span> <span style="color: rgb(223, 223, 191);">response</span> = 
<span style="color: rgb(223, 223, 191);">    session</span>.<span style="color: rgb(223, 223, 191);">ProcessRequest</span>
    (<span style="color: rgb(223, 223, 191);">session</span>.<span style="color: rgb(223, 223, 191);">CreateUpdatePanelRequest</span>
    (<span style="color: rgb(200, 145, 145);">&quot;Button1&quot;</span>));</pre>
</div>
<p>That's all for AJAX functionality in the current release. I'd probably have to fix a few bugs or provide more options and better API in the future releases. Please give me some feedback in the Forums.</p>
<p>As for the optimization stuff, I already wrote about it in the previous post, so there's not much to add.</p>
<p>So, what's the roadmap for 2.2? I guess it's going to be extensibility. The code is complicated enough to introduce an IoC container (it's going to be StructureMap), and I'd like to open some possibilities for custom request and response types, as well as modify the initialization aspects for advanced scenarios. You are welcome, as always, to suggest an extension you want, and I'll make Ivonna flexible enough to satisfy your needs.</p>&nbsp;&nbsp;<a href='http://www.sm-art.biz/ivonna-21-is-out.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>Notes on new performance enhancements in Ivonna 2.1</title>
      <link>http://www.sm-art.biz/notes-on-new-performance-enhancements-in-ivonna-21.aspx</link>
      <pubDate>Sat, 06 Feb 2010 11:30:44 GMT</pubDate>
      <guid>http://www.sm-art.biz/notes-on-new-performance-enhancements-in-ivonna-21.aspx</guid>
      <comments>http://www.sm-art.biz/notes-on-new-performance-enhancements-in-ivonna-21.aspx</comments>
      <description><![CDATA[<p>Ivonna 2.1 is due this weekend, and while I've been testing the final bits, I noticed a bug which cannot be fixed without changing the overall architecture, so I decided to leave it and be clear about it.</p>
<p>One of the most annoying things about Ivonna was her bad performance on startup. Every time I needed to run a test, the Asp.Net engine cleared the temp folder and recompiled the whole site. It would take up to several minutes, depending on the number of pages. So, in the 2.1 release, I decided to stub the whole thing. The startup time dropped to several seconds, which is sort of acceptable (note that each test itself takes much less time to run).</p>
<p>Everything went fine until I put some code in an App_Code class, and Ivonna couldn't load it. It turned out that <b>no changes in the App_Code folder could be recognized by the test</b>. However, changes in the codebehind are recognized.</p>
<p>The workaround is, <b>whenever you make a change to or create an App_Code class</b>, be sure to <b>delete the temporary site folder</b>, which is usually under the C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\ folder.</p>&nbsp;&nbsp;<a href='http://www.sm-art.biz/notes-on-new-performance-enhancements-in-ivonna-21.aspx'>...</a>]]></description>
    </item>
  </channel>
</rss>
