<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Development Blog &#187; C#</title>
	<atom:link href="http://blog.yeticode.co.uk/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.yeticode.co.uk</link>
	<description>John Tindell's Blog For Development Related Things</description>
	<lastBuildDate>Wed, 23 Jun 2010 18:17:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Running NHibernate in Medium Trust</title>
		<link>http://blog.yeticode.co.uk/2010/03/running-nhibernate-in-medium-trust/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=running-nhibernate-in-medium-trust</link>
		<comments>http://blog.yeticode.co.uk/2010/03/running-nhibernate-in-medium-trust/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 23:34:50 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Development Log]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Castle]]></category>
		<category><![CDATA[Medium Trust]]></category>
		<category><![CDATA[NHibernate]]></category>

		<guid isPermaLink="false">http://blog.yeticode.co.uk/?p=636</guid>
		<description><![CDATA[After deploying a NHibernate to a shared host I started running into a number of issues. Whilst developing we were running in full trust not in medium trust whilst the majority of shared hosts use. After hours and hours of searching I finally come across a post on the Castle Project mailing list which detailed [...]]]></description>
			<content:encoded><![CDATA[<p>After deploying a NHibernate to a shared host I started running into a number of issues. Whilst developing we were running in full trust not in medium trust whilst the majority of shared hosts use. After hours and hours of searching I finally come across a <a href="http://groups.google.com/group/castle-project-users/browse_thread/thread/2451ef352523865f?hl=en&#038;pli=1">post</a> on the <a href="http://groups.google.com/group/castle-project-users?hl=en">Castle Project mailing list</a> which detailed how to get a nhibernate working under medium trust. Here is the steps I followed to get it working.</p>
<p>I am using NHibernate 2.1.2 and C# .NET 3.5 in Visual Studio 2008.</p>
<h3>Step 1</h3>
<p>Download Castle.Core from gitbhub<br />
git://github.com/castleproject/Castle.Core.git</p>
<p><a href="http://blog.yeticode.co.uk/wp-content/uploads/2010/03/Screenshot-1.png" rel="lightbox[636]"><img src="http://blog.yeticode.co.uk/wp-content/uploads/2010/03/Screenshot-1.png" alt="" title="Screenshot-1" width="489" height="337" class="alignnone size-full wp-image-647" /></a></p>
<h3>Step 2</h3>
<p>Enable Castle to allow partially trusted callers.<br />
Open buildscripts/CommonAssemblyInfo.cs and enable the library to enable partially trusted callers</p>
<p><a href="http://blog.yeticode.co.uk/wp-content/uploads/2010/03/Screenshot-2.png" rel="lightbox[636]"><img src="http://blog.yeticode.co.uk/wp-content/uploads/2010/03/Screenshot-2.png" alt="" title="Screenshot-2" width="589" height="286" class="alignnone size-full wp-image-654" /></a></p>
<h3>Step 3</h3>
<p>Disable generation of debug information for the projects Castle.Core and Castle.DynamicProxy.<br />
<a href="http://blog.yeticode.co.uk/wp-content/uploads/2010/03/Screenshot-4.png" rel="lightbox[636]"><img src="http://blog.yeticode.co.uk/wp-content/uploads/2010/03/Screenshot-4-300x175.png" alt="" title="Screenshot-4" width="300" height="175" class="alignnone size-medium wp-image-657" /></a></p>
<h3>Step 4</h3>
<p>Build the projects</p>
<h3>Step 5</h3>
<p>Download Nhibernate source code from source forge.</p>
<p><a href="http://sourceforge.net/projects/nhibernate/files/" rel="nofollow">http://sourceforge.net/projects/nhibernate/files/</a></p>
<h3>Step 6</h3>
<p>Open Nhibernate.Everything.sln and update the references for the NHibernate.ByteCode.Castle project so that the references for Castle.Core and Castle.DynamicProxy2 are the libraries build in step 4. Disable generation of debug information for the projects NHibernate, Iesi.Collections and NHibernate.ByteCode.Castle, similar to what was done in step 3.</p>
<p><a href="http://blog.yeticode.co.uk/wp-content/uploads/2010/03/Screenshot-5.png" rel="lightbox[636]"><img src="http://blog.yeticode.co.uk/wp-content/uploads/2010/03/Screenshot-5-300x187.png" alt="" title="Screenshot-5" width="300" height="187" class="alignnone size-medium wp-image-661" /></a></p>
<h3>Step 7</h3>
<p>Copy the outputted library files from NHibernate.ByteCode/bin/Release to your shared libs folder of your project.</p>
<p><a href="http://blog.yeticode.co.uk/wp-content/uploads/2010/03/Screenshot-6.png" rel="lightbox[636]"><img src="http://blog.yeticode.co.uk/wp-content/uploads/2010/03/Screenshot-6-300x225.png" alt="" title="Screenshot-6" width="300" height="225" class="alignnone size-medium wp-image-663" /></a></p>
<h3>Step 8</h3>
<p>Update the references in your project to point to the new libraries. Next turn off reflection optimization. This needs to be done in code before you create the configuration object. Configuring this in the hibernate.cfg.xml does not work. Update all your projects assemblies to set allow partially trusted callers, similar to step 2. Update your web.config to set requirePermission=&#8221;false&#8221; in the nhibernate section delceration</p>
<pre class="c-sharp" name="code">
NHibernate.Cfg.Environment.UseReflectionOptimizer = false;
Configuration = new Configuration();
Configuration.Configure();
</pre>
<pre name="code" class="xml">
<configSections>
<section name="hibernate-configuration" requirePermission="false" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"/>
</configSections>
</pre>
<p>You can now run your site in medium trust using lay loading.</p>
<h2>Links</h2>
<ul>
<li><b>msysgit</b> &#8211; <a href="http://code.google.com/p/msysgit/" rel="nofollow">http://code.google.com/p/msysgit/</a></li>
<li><b>TortoiseGit</b> &#8211; <a href="http://code.google.com/p/tortoisegit/" rel="nofollow">http://code.google.com/p/tortoisegit/</a></li>
<li><b>NHibernate</b> &#8211; <a href="http://nhforge.org/" rel="nofollow">http://nhforge.org/</a></li>
<li><b>Castle.Core Source</b> &#8211; <a href="http://github.com/castleproject/" rel="nofollow">http://github.com/castleproject/</a></li>
<li><b>NHibernate Source</b> &#8211; <a href="http://sourceforge.net/projects/nhibernate/files/" rel="nofollow">http://sourceforge.net/projects/nhibernate/files/</a></li>
</ul>
<h2>Related Reading</h2>
<table>
<tr>
<td>
<a style="display:inline-block;" href="http://www.amazon.co.uk/gp/product/1932394923?ie=UTF8&#038;tag=yetiblog-21&#038;linkCode=as2&#038;camp=1634&#038;creative=19450&#038;creativeASIN=1932394923"><img border="0" src="http://static.yeticode.co.uk/blog/images/nhibernate.jpg"></a><img src="http://www.assoc-amazon.co.uk/e/ir?t=yetiblog-21&#038;l=as2&#038;o=2&#038;a=1932394923" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
</td>
<td>
<a style="display:inline-block;" href="http://www.amazon.co.uk/gp/product/0321228103?ie=UTF8&#038;tag=worldoverride-21&#038;linkCode=as2&#038;camp=1634&#038;creative=19450&#038;creativeASIN=0321228103"><img border="0" src="http://static.yeticode.co.uk/blog/images/open_source_dot_net.jpg"></a><img src="http://www.assoc-amazon.co.uk/e/ir?t=worldoverride-21&#038;l=as2&#038;o=2&#038;a=0321228103" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;display:inline-block;" />
</td>
<td>
<a style="display:inline-block;" href="http://www.amazon.co.uk/gp/product/1847198902?ie=UTF8&#038;tag=worldoverride-21&#038;linkCode=as2&#038;camp=1634&#038;creative=19450&#038;creativeASIN=1847198902"><img border="0" src="http://static.yeticode.co.uk/blog/images/nhibernate_2.jpg"></a><img src="http://www.assoc-amazon.co.uk/e/ir?t=worldoverride-21&#038;l=as2&#038;o=2&#038;a=1847198902" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
</td>
</tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.yeticode.co.uk/2010/03/running-nhibernate-in-medium-trust/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>NAnt.ToDo a NAnt Plugin</title>
		<link>http://blog.yeticode.co.uk/2010/01/nant-todo-a-nant-plugin/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=nant-todo-a-nant-plugin</link>
		<comments>http://blog.yeticode.co.uk/2010/01/nant-todo-a-nant-plugin/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 19:02:25 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Development Log]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[CruiseControl.NET]]></category>
		<category><![CDATA[NAnt]]></category>

		<guid isPermaLink="false">http://blog.yeticode.co.uk/?p=611</guid>
		<description><![CDATA[This simple plugin for NAnt parses your source code and creates a report of all the TODO and comment tags in your source code. The code is hosted over at google code. Comments The task automatically identify comments in the following style //TODO: First Test to do Item //FIXME: First Fix me Item //HACK: First [...]]]></description>
			<content:encoded><![CDATA[<p>This simple plugin for NAnt parses your source code and creates a report of all the TODO and comment tags in your source code. The code is hosted over at <a href="http://code.google.com/p/nant-todo/">google code</a>.</p>
<h2>Comments</h2>
<p>The task automatically identify comments in the following style</p>
<pre name="code" class="c-sharp">
//TODO: First Test to do Item
//FIXME: First Fix me Item
//HACK: First Hack Item
</pre>
<p>Additional matches can be made by adding in Token elements to the NAnt task. </p>
<h2>Sample</h2>
<pre name="code" class="xml">
&lt;ToDo source="path/to/source" output="report.xml" searchpattern="*.cs;*.txt"&gt;
 &lt;Tokens&gt;
 &lt;Tokens Value="BUGFIX" /&gt;
 &lt;/Tokens&gt;
&lt;/ToDo&gt;
</pre>
<h2>Output</h2>
<pre name="code" class="xml">
&lt;ToDo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
 &lt;Items&gt;
 &lt;Item&gt;
 &lt;Message&gt;First Test to do Item&lt;/Message&gt;
 &lt;File&gt;NAnt.ToDo\ToDoTask.cs&lt;/File&gt;
 &lt;Line&gt;0&lt;/Line&gt;
 &lt;Type&gt;TODO&lt;/Type&gt;
 &lt;/Item&gt;
 &lt;Item&gt;
 &lt;Message&gt;First Hack Item&lt;/Message&gt;
 &lt;File&gt;NAnt.ToDo\ToDoTask.cs&lt;/File&gt;
 &lt;Line&gt;0&lt;/Line&gt;
 &lt;Type&gt;HACK&lt;/Type&gt;
 &lt;/Item&gt;
 &lt;Item&gt;
 &lt;Message&gt;First Fix me Item&lt;/Message&gt;
 &lt;File&gt;NAnt.ToDo\ToDoTask.cs&lt;/File&gt;
 &lt;Line&gt;0&lt;/Line&gt;
 &lt;Type&gt;FIXME&lt;/Type&gt;
 &lt;/Item&gt;
 &lt;/Items&gt;
&lt;/ToDo&gt;
</pre>
<h2>Cruise Control Xsl</h2>
<p>Below is a basic xsl style sheet that can be used with CruiseControl.NET to display the output from NAnt.ToDo.</p>
<pre name="code" class="xml">
&lt;?xml version="1.0"?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt;
 &lt;xsl:output method="html"/&gt;
 &lt;xsl:param name="applicationPath"/&gt;
 &lt;xsl:template match="/"&gt;
 &lt;div id="ToDo"&gt;
 &lt;h1&gt;ToDo List&lt;/h1&gt;
 &lt;div id="Summary"&gt;
 &lt;h3&gt;To Do&lt;/h3&gt;
 &lt;table&gt;
 &lt;tbody&gt;
 &lt;xsl:for-each select="//ToDo/Items/Item"&gt;
 &lt;tr&gt;
 &lt;td&gt;
 &lt;xsl:value-of select="Type/text()"/&gt;
 &lt;/td&gt;
 &lt;td&gt;
 &lt;xsl:value-of select="Message/text()"/&gt;
 &lt;/td&gt;
 &lt;td&gt;
 &lt;xsl:value-of select="File/text()"/&gt;
 &lt;/td&gt;
 &lt;/tr&gt;
 &lt;/xsl:for-each&gt;
 &lt;/tbody&gt;
 &lt;/table&gt;
 &lt;/div&gt;    
 &lt;/div&gt;
 &lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
</pre>]]></content:encoded>
			<wfw:commentRss>http://blog.yeticode.co.uk/2010/01/nant-todo-a-nant-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jqRunner Snapshot &#8211; Running Javascript Unit test with NUnit</title>
		<link>http://blog.yeticode.co.uk/2009/09/jqrunner-snapshot-running-javascript-unit-test-with-nunit/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=jqrunner-snapshot-running-javascript-unit-test-with-nunit</link>
		<comments>http://blog.yeticode.co.uk/2009/09/jqrunner-snapshot-running-javascript-unit-test-with-nunit/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 21:06:47 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Development Log]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[CruiseControl.NET]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jqunit]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://blog.yeticode.co.uk/?p=592</guid>
		<description><![CDATA[One of the nice things about unit tests is that you can use continuous integration so that you don&#8217;t have to run them yourself. At work we use CruiseControl.NET to automate our builds and run our unit tests. Now as a number of our projects are web based we use a fair amount of javascript, [...]]]></description>
			<content:encoded><![CDATA[<p>One of the nice things about unit tests is that you can use continuous integration so that you don&#8217;t have to run them yourself. At work we use <a href="http://ccnet.thoughtworks.com">CruiseControl.NET</a> to automate our builds and run our unit tests. Now as a number of our projects are web based we use a fair amount of javascript, mainly jQuery, though in-house plugins. In order to test these we use <a href="http://code.google.com/p/jqunit/">jqunit</a>, this works great and allows us to use TDD when writing javascript. However as development goes on the unit tests get forgotten about as they are not automatically ran.</p>
<p>In order so solve this I decided to experiment to find a method of getting cruise control to run our jqunit tests for me. To run the tests I looked at wrapping the jqunit tests with nunit tests.</p>
<p><a href="http://static.yeticode.co.uk/blog/images/posts/jqRunner_nunit.png" rel="lightbox"><img src="http://static.yeticode.co.uk/blog/images/posts/jqRunner_nunit_thumb.png" alt="jqRunner"/></a></p>
<p>jqRunner is designed so that you can us your existing jqunit tests in their existing location without changing them. jqRunner required that all the scripts that are needed to run are registered. The full path to the file is required. jqRunner then executes the tests and returns the results, which are then parsed by nunit as tests using the TestCaseSource attribute.</p>
<pre class="javascript" name="code">
var sampleTestCase = new jqUnit.TestCase('Sample Test Case', function() {
    /*setup*/
    // this.yep(1);
}, function() {
    /*teardown*/
    // this.ok(1)
});
sampleTestCase.test('Sample Test 1', function() {
    this.ok(1);
});
sampleTestCase.test('Sample Test 2', function() {
    this.ok(0);
});
</pre>
<pre class="c-sharp" name="code">
using System;
using System.Collections.Generic;
using NUnit.Framework;
using jqRunner;
using System.IO;
using System.Reflection;

namespace jqRunner.Tests
{
    [TestFixture,RequiresSTA]
    public class TestCaseSourceTests
    {
        [Test, TestCaseSource("GetTestResults"), RequiresSTA]
        public void CheckTest(ITestResult result)
        {
            Assert.IsTrue(result.Pass, result.Name);
        }

        private static ITestResult[] GetTestResults()
        {
            string jsFile = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase) + @"\jqUnitTests\SampleUnitTest.js";
            TestBed target = new TestBed();
            target.RegisterScript(jsFile);
            return target.Execute().ToArray();
        }
    }
}
</pre>
<p>This is an initial development snapshot and is bound to have plenty of problems.</p>
<p><b>Download</b><br />
<a href="http://static.yeticode.co.uk/blog/downloads/jqRunner-snapshot.zip">http://static.yeticode.co.uk/blog/downloads/jqRunner-snapshot.zip</a></p>
<h2>Related Reading</h2>
<table>
<tr>
<td>
<a href="http://www.amazon.co.uk/gp/product/0596007396?ie=UTF8&#038;tag=worldoverride-21&#038;linkCode=as2&#038;camp=1634&#038;creative=19450&#038;creativeASIN=0596007396"><img border="0" src="http://static.yeticode.co.uk/blog/images/nunit.jpg"></a><img src="http://www.assoc-amazon.co.uk/e/ir?t=worldoverride-21&#038;l=as2&#038;o=2&#038;a=0596007396" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
</td>
<td>
<a style="display:inline-block;" href="http://www.amazon.co.uk/gp/product/0321228103?ie=UTF8&#038;tag=worldoverride-21&#038;linkCode=as2&#038;camp=1634&#038;creative=19450&#038;creativeASIN=0321228103"><img border="0" src="http://static.yeticode.co.uk/blog/images/open_source_dot_net.jpg"></a><img src="http://www.assoc-amazon.co.uk/e/ir?t=worldoverride-21&#038;l=as2&#038;o=2&#038;a=0321228103" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;display:inline-block;" />
</td>
</tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.yeticode.co.uk/2009/09/jqrunner-snapshot-running-javascript-unit-test-with-nunit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More Django Plugin Stuff</title>
		<link>http://blog.yeticode.co.uk/2009/08/more-django/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=more-django</link>
		<comments>http://blog.yeticode.co.uk/2009/08/more-django/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 19:34:38 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Development Log]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[MonoDevelop]]></category>

		<guid isPermaLink="false">http://blog.yeticode.co.uk/?p=553</guid>
		<description><![CDATA[So I&#8217;ve been working more on the support for django within monodevelop. Heres some screenshots of it.]]></description>
			<content:encoded><![CDATA[<p><a href="http://static.yeticode.co.uk/blog/images/posts/monodevelop-django-2.png" rel="lightbox"><img alt="MonoDevelop Django" src="http://static.yeticode.co.uk/blog/images/posts/monodevelop-django-2-thumb.png"/></a></p>
<p>So I&#8217;ve been working more on the support for django within monodevelop. Heres some screenshots of it.</p>
<p><img alt="MonoDevelop Django" src="http://static.yeticode.co.uk/blog/images/posts/monodevelop-django-3.png"/></p>
<p><img alt="MonoDevelop Django" src="http://static.yeticode.co.uk/blog/images/posts/monodevelop-django-4.png"/></p>]]></content:encoded>
			<wfw:commentRss>http://blog.yeticode.co.uk/2009/08/more-django/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Professional ASP.NET MVC 1.0</title>
		<link>http://blog.yeticode.co.uk/2009/06/professional-asp-net-mvc-1-0/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=professional-asp-net-mvc-1-0</link>
		<comments>http://blog.yeticode.co.uk/2009/06/professional-asp-net-mvc-1-0/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 18:21:38 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Development Log]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[VS.NET]]></category>

		<guid isPermaLink="false">http://blog.yeticode.co.uk/?p=267</guid>
		<description><![CDATA[At work we have been looking at the ASP.NET MVC, model-view-controller, framework. After looking around at various different tutorials and articles we found a sample chapter from the wrox book Professional ASP.NET MVC 1.0. The sample chapter took the hello world example and create a full application. The application, NerdDinner is an application that allows [...]]]></description>
			<content:encoded><![CDATA[<p>At work we have been looking at the ASP.NET MVC, model-view-controller, framework. After looking around at various different tutorials and articles we found a sample chapter from the wrox book Professional ASP.NET MVC 1.0. The sample chapter took the hello world example and create a full application. The application, <a href="http://www.nerddinner.com/">NerdDinner</a> is an application that allows you to create dinner parties and RSPV to them. The sample covers a lot of the functionality that is within ASP.NET MVC. The sample chapter can be found online at <a href="http://tinyurl.com/aspnetmvc">Wrox&#8217;s website</a> with the source code hosted at <a href="http://nerddinner.codeplex.com/">codeplex</a>.</p>
<p align="center">
<a href="http://www.amazon.co.uk/gp/product/0470384611?ie=UTF8&amp;tag=yetiblog-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0470384611" style="display: block-inline;"><br />
<img src="http://static.yeticode.co.uk/blog/images/wrox_asp_net_mvc.jpg" alt="Professional ASP.NET MVC 1.0" /><br />
</a>
</p>
<p>Reading though the sample chapter is a good way to get started with ASP.NET MVC as the chapter explains what it is doing in a easy to understand manor, but more importantly it explains why they are being done. The chapter is a comprehensive walk through of how to create the NerdDinner application. Throughout the chapter the authors provide titbits of useful information, for example the use of the repository pattern and dependency injection. Throughout the chapter the authors trying to enforce good coding practice and often make reference to <a href="http://en.wikipedia.org/wiki/Test-driven_development">test driven development</a> which in a later chapter they go into more detail about, discussing different development techniques.</p>
<p>The sample chapter is more than enough to get anyone started with ASP.NET MVC and follows the development process from start to finish including a section on unit testing the application. The following chapters delve into more detail about specific areas of the ASP.NET MVC framework. The second and third chapters go into detail about the MVC pattern, detailing its background and its use on the web. The chapter also provides an overview, albeit brief, of other frameworks that are available. Although their coverage was brief they were not mentioned as either superior or inferior rather just as alternatives to the ASP.NET MVC framework. This tone was subsequently repeated in the third chapter when the authors compare ASP.NET with WebForms to ASP.NET MVC. They often mention that MVC is not a replacement for WebForms rather it is a different approach. These two chapters are extremely useful as they allow you to make an informed decision whether ASP.NET MVC is the right choice for you.</p>
<p>I&#8217;ve still to finish reading the rest of this book so I&#8217;ll update this post the more I read of it.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.yeticode.co.uk/2009/06/professional-asp-net-mvc-1-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NUnit and NMock</title>
		<link>http://blog.yeticode.co.uk/2009/05/nunit-and-nmock/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=nunit-and-nmock</link>
		<comments>http://blog.yeticode.co.uk/2009/05/nunit-and-nmock/#comments</comments>
		<pubDate>Sun, 24 May 2009 19:14:49 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Development Log]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[nmock]]></category>
		<category><![CDATA[nunit]]></category>

		<guid isPermaLink="false">http://blog.yeticode.co.uk/?p=213</guid>
		<description><![CDATA[Whist working on a piece of course work for uni I started using NMock as part of some unit tests written using nunit. Having mainly used MSTests for unit tests at work I decided to use nunit as everyone has said that they are very similar. I&#8217;m extremely impressed with the potential power that NMock [...]]]></description>
			<content:encoded><![CDATA[<p>Whist working on a piece of course work for uni I started using <a href="http://www.nmock.org/">NMock</a> as part of some unit tests written using nunit. Having mainly used MSTests for unit tests at work I decided to use nunit as everyone has said that they are very similar. I&#8217;m extremely impressed with the potential power that NMock has given me during testing. For the assignment I wrote a small spider application that crawly a site and stores all the link. Using NMock it allowed me to test the structure of the site without requiring internet access. During this assignment I also tried to use the <a href="http://en.wikipedia.org/wiki/Test-driven_development">test driven development</a> approach, opposed to my normal sit down and hack away. Not only were there less bugs at the end, the overall quality of my code was noticeable higher. This was largely due to the fact that I had tests already created for what it was meant to do, which required me to put more effort into the implementation. Hopefully I&#8217;ll keep this style of programming up, and not just forget it as soon as I get back to work.</p>
<p>Here&#8217;s a sample nunit test that uses nmock. The nmock object mocks the calls that request specific urls and loads the data for local files.</p>
<pre name="code" class="csharp">
[Test()]
public void MockLinkFinderTest()
{
	IMock mockWebClient = new DynamicMock(typeof(IWebClient));
	mockWebClient.ExpectAndReturn("GetPage",File.ReadAllText("HTML/1.htm"),new object[]{"http://domain.example/1.htm"});
	mockWebClient.ExpectAndReturn("GetPage",File.ReadAllText("HTML/2.htm"),new object[]{"http://domain.example/2.htm"});
	mockWebClient.ExpectAndReturn("GetPage",File.ReadAllText("HTML/3.htm"),new object[]{"http://domain.example/3.htm"});

	string domain = "domain.example";
	string url = "http://domain.example/1.htm";

	LinkFinder linkFinder = new LinkFinder();
	LinkItemCollection linkCollection = linkFinder.Find(url,domain,(IWebClient)mockWebClient.MockInstance);

	int expected = 3;
	Assert.AreEqual(expected,linkCollection.Count);
}
</pre>]]></content:encoded>
			<wfw:commentRss>http://blog.yeticode.co.uk/2009/05/nunit-and-nmock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New GTK# Project</title>
		<link>http://blog.yeticode.co.uk/2009/05/new-gtk-project/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=new-gtk-project</link>
		<comments>http://blog.yeticode.co.uk/2009/05/new-gtk-project/#comments</comments>
		<pubDate>Wed, 13 May 2009 00:59:22 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Development Log]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[gtk]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mono]]></category>

		<guid isPermaLink="false">http://blog.yeticode.co.uk/?p=202</guid>
		<description><![CDATA[I&#8217;ve started a new project, RssNotify, to try and learn more about developing applications using GTK. I&#8217;ll still be developing cctray-gtk as this project is useful, but the RssNotify is more of a project to satisfy my curiosity. The RssNotify project aims to provide an easy way for a user to receive notifications when an [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started a new project, <a href="https://launchpad.net/rssnotify">RssNotify</a>, to try and learn more about developing applications using GTK. I&#8217;ll still be developing cctray-gtk as this project is useful, but the RssNotify is more of a project to satisfy my curiosity.</p>
<p>The RssNotify project aims to provide an easy way for a user to receive notifications when an rss feed has been updated. the idea is to use notify-sharp to display the new news items. The rest of the interface will be used to try to explore the features widgets that GTK# offers.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.yeticode.co.uk/2009/05/new-gtk-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CCTray updates and Mono musings</title>
		<link>http://blog.yeticode.co.uk/2009/05/cctray-updates-and-mono-musings/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=cctray-updates-and-mono-musings</link>
		<comments>http://blog.yeticode.co.uk/2009/05/cctray-updates-and-mono-musings/#comments</comments>
		<pubDate>Wed, 06 May 2009 19:15:44 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Development Log]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[cctray]]></category>
		<category><![CDATA[gtk]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mono]]></category>

		<guid isPermaLink="false">http://blog.yeticode.co.uk/?p=184</guid>
		<description><![CDATA[Impleneted some more to the CCTray-gtk project with the ability to add build servers that communicate over HTTP. This did involve commenting out some of the code in the CCTrayLib project, which was unavoidable. The issue occurred as the library added a delegate to the Service point manager ServicePointManager.ServerCertificateValidationCallback = delegate{ return true; } These [...]]]></description>
			<content:encoded><![CDATA[<p>Impleneted some more to the CCTray-gtk project with the ability to add build servers that communicate over HTTP. This did involve commenting out some of the code in the CCTrayLib project, which was unavoidable. The issue occurred as the library added a delegate to the Service point manager </p>
<pre name="code" class="c-sharp">
ServicePointManager.ServerCertificateValidationCallback = delegate{ return true; }
</pre>
<p>These were causing an exception to be thrown as it is currently not implemented in mono. This so far is the only part of mono that I&#8217;ve found that has caused any problems.</p>
<p><a href="https://bugzilla.novell.com/show_bug.cgi?id=346561">https://bugzilla.novell.com/show_bug.cgi?id=346561</a></p>
<p>I&#8217;ve also started to implement the ability to remove a project, at the moment it removes the project from the preferences window but does not yet remove the associated project monitor or remove it from the main window&#8217;s treeview.</p>
<p>Once this has been implemented I will create a release or something for testing.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.yeticode.co.uk/2009/05/cctray-updates-and-mono-musings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# Style for lstinputlisting</title>
		<link>http://blog.yeticode.co.uk/2009/04/c-sharp-style-for-lstinputlisting/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=c-sharp-style-for-lstinputlisting</link>
		<comments>http://blog.yeticode.co.uk/2009/04/c-sharp-style-for-lstinputlisting/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 14:09:28 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Off Topic]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[latex]]></category>

		<guid isPermaLink="false">http://blog.yeticode.co.uk/?p=142</guid>
		<description><![CDATA[After getting latex to format my code nicely I noticed that it did not have build in support for C#, which read of the manual and knocked one up. Share and Enjoy \lstdefinelanguage{cs} {morekeywords={abstract,event,new,struct,as,explicit,null,switch base,extern,object,this,bool,false,operator,throw, break,finally,out,true,byte,fixed,override,try, case,float,params,typeof,catch,for,private,uint, char,foreach,protected,ulong,checked,goto,public,unchecked, class,if,readonly,unsafe,const,implicit,ref,ushort, continue,in,return,using,decimal,int,sbyte,virtual, default,interface,sealed,volatile,delegate,internal,short,void, do,is,sizeof,while,double,lock,stackalloc, else,long,static,enum,namespace,string, }, sensitive=false, morecomment=[l]{//}, morecomment=[s]{/*}{*/}, morestring=[b]", } Usage \lstinputlisting[language=cs]{test-class.cs}]]></description>
			<content:encoded><![CDATA[<p>After getting latex to format my code nicely I noticed that it did not have build in support for C#, which read of the <a href="http://www.ctan.org/tex-archive/macros/latex/contrib/listings/listings.pdf">manual</a> and knocked one up. Share and Enjoy</p>
<pre>
\lstdefinelanguage{cs}
  {morekeywords={abstract,event,new,struct,as,explicit,null,switch
		base,extern,object,this,bool,false,operator,throw,
		break,finally,out,true,byte,fixed,override,try,
		case,float,params,typeof,catch,for,private,uint,
		char,foreach,protected,ulong,checked,goto,public,unchecked,
		class,if,readonly,unsafe,const,implicit,ref,ushort,
		continue,in,return,using,decimal,int,sbyte,virtual,
		default,interface,sealed,volatile,delegate,internal,short,void,
		do,is,sizeof,while,double,lock,stackalloc,
		else,long,static,enum,namespace,string, },
	  sensitive=false,
	  morecomment=[l]{//},
	  morecomment=[s]{/*}{*/},
	  morestring=[b]",
}
</pre>
<p>Usage</p>
<pre>
\lstinputlisting[language=cs]{test-class.cs}
</pre>]]></content:encoded>
			<wfw:commentRss>http://blog.yeticode.co.uk/2009/04/c-sharp-style-for-lstinputlisting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cruise Control Tray For Linux Update</title>
		<link>http://blog.yeticode.co.uk/2009/03/cruise-control-tray-for-linux-update/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=cruise-control-tray-for-linux-update</link>
		<comments>http://blog.yeticode.co.uk/2009/03/cruise-control-tray-for-linux-update/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 03:01:33 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Off Topic]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[cctray]]></category>
		<category><![CDATA[CruiseControl.NET]]></category>
		<category><![CDATA[gtk]]></category>
		<category><![CDATA[mono]]></category>

		<guid isPermaLink="false">http://blog.yeticode.co.uk/?p=79</guid>
		<description><![CDATA[Basic functionality has been implemented with the ability to add project to monitor and receive notifications of the build as and when they occur. At the moment there is not the ability to delete a project that is being monitor this will be implemented next. There is also the ability to force a build of [...]]]></description>
			<content:encoded><![CDATA[<p>Basic functionality has been implemented with the ability to add project to monitor and receive notifications of the build as and when they occur. At the moment there is not the ability to delete a project that is being monitor this will be implemented next. There is also the ability to force a build of a project, however there is not the ability to abort the build, this will also been implemented in the next couple of days hopefully.  Here are some more screen shots of what it currently looks like. The build notification have also been attached to the tray icon.</p>
<p><img src="http://dev.yeticode.co.uk/jt/dev/cctray/cctray-4.png"/><br />
<img src="http://dev.yeticode.co.uk/jt/dev/cctray/cctray-5.png"/><br />
<img src="http://dev.yeticode.co.uk/jt/dev/cctray/cctray-6.png"/></p>]]></content:encoded>
			<wfw:commentRss>http://blog.yeticode.co.uk/2009/03/cruise-control-tray-for-linux-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
