<?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>Over It. &#187; .NET</title>
	<atom:link href="http://jason.diamond.name/weblog/tag/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://jason.diamond.name/weblog</link>
	<description>(a Weblog by Jason Diamond)</description>
	<lastBuildDate>Mon, 12 Jul 2010 00:58:14 +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>BehaveN</title>
		<link>http://jason.diamond.name/weblog/2010/07/11/behaven/</link>
		<comments>http://jason.diamond.name/weblog/2010/07/11/behaven/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 00:58:14 +0000</pubDate>
		<dc:creator>Jason Diamond</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[BDD]]></category>
		<category><![CDATA[BehaveN]]></category>

		<guid isPermaLink="false">http://jason.diamond.name/weblog/?p=110</guid>
		<description><![CDATA[I&#8217;ve been using a Cucumber-inspired BDD framework for .NET called BehaveN at work for the past year. Today, I just released the next major version. There&#8217;s a little documentation on the wiki, including a tutorial, but there&#8217;s a lot left that I haven&#8217;t documented yet. I&#8217;ll be getting more and more documentation up as time [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using a <a href="http://cukes.info/">Cucumber</a>-inspired BDD framework for .NET called <a href="http://code.google.com/p/behaven/">BehaveN</a> at work for the past year. Today, I just released the next major version.</p>
<p>There&#8217;s a little documentation on the wiki, including a <a href="http://code.google.com/p/behaven/wiki/Tutorial">tutorial</a>, but there&#8217;s a lot left that I haven&#8217;t documented yet. I&#8217;ll be getting more and more documentation up as time goes on.</p>
<p>It&#8217;s been pretty positively received by our product owners, QA, and most of the developers who&#8217;ve been exposed to it. It&#8217;s being used by a few outside my company, but I haven&#8217;t made any effort on &#8220;advertising&#8221; it. If anybody&#8217;s interested in giving it a try, let me know and I&#8217;ll try to fill in any of the blanks you might have.</p>
]]></content:encoded>
			<wfw:commentRss>http://jason.diamond.name/weblog/2010/07/11/behaven/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AutoRunner Downloads</title>
		<link>http://jason.diamond.name/weblog/2009/09/28/autorunner-downloads/</link>
		<comments>http://jason.diamond.name/weblog/2009/09/28/autorunner-downloads/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 04:23:06 +0000</pubDate>
		<dc:creator>Jason Diamond</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[AutoRunner]]></category>
		<category><![CDATA[BDD]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://jason.diamond.name/weblog/?p=75</guid>
		<description><![CDATA[I took some time tonight to throw together a build script for producing proper releases of AutoRunner. If you don&#8217;t feel like compiling it yourself, you can get a pre-compiled version here. I used ILMerge to merge the Growl for Windows assemblies into the executable so it&#8217;s basically a single file now. By the way, [...]]]></description>
			<content:encoded><![CDATA[<p>I took some time tonight to throw together a build script for producing proper releases of <a href="http://github.com/jdiamond/autorunner">AutoRunner</a>. If you don&#8217;t feel like compiling it yourself, you can get a pre-compiled version <a href="http://github.com/jdiamond/autorunner/downloads">here</a>.</p>
<p>I used <a href="http://research.microsoft.com/en-us/people/mbarnett/ilmerge.aspx">ILMerge</a> to merge the <a href="http://www.growlforwindows.com/">Growl for Windows</a> assemblies into the executable so it&#8217;s basically a single file now.</p>
<p>By the way, last night on Twitter, <a href="http://blog.unhandled-exceptions.com/">Steve Bohlen</a> pointed me to <a href="http://averyblog.com/net/announcing-autotest-net-0-1/">this port of the original autotest to .NET</a>. I took a look at the code and it was much more complex than I was looking for. It actually builds and runs your tests every time you save which is much more often than I want.</p>
<p>I had AutoRunner turned on all day at work today and was loving how it would catch me breaking the tests when I wasn&#8217;t expecting it to. =)</p>
]]></content:encoded>
			<wfw:commentRss>http://jason.diamond.name/weblog/2009/09/28/autorunner-downloads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AutoRunner</title>
		<link>http://jason.diamond.name/weblog/2009/09/27/autorunner/</link>
		<comments>http://jason.diamond.name/weblog/2009/09/27/autorunner/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 23:13:28 +0000</pubDate>
		<dc:creator>Jason Diamond</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[AutoRunner]]></category>
		<category><![CDATA[BDD]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://jason.diamond.name/weblog/?p=66</guid>
		<description><![CDATA[I recently came across this awesome code kata performance by Corey Haines here. Besides enjoying and learning from his actual performance, I was really impressed by his use of a Ruby tool called autotest. (I&#8217;m not sure, but it looks like it has become autospec.) Not being a Ruby developer, I wanted the same thing [...]]]></description>
			<content:encoded><![CDATA[<p>I recently came across this awesome code kata performance by Corey Haines <a href="http://charlesmaxwood.com/8-lessons-from-corey-haines-performance-kata/">here</a>.</p>
<p>Besides enjoying and learning from his actual performance, I was really impressed by his use of a Ruby tool called <a href="http://ph7spot.com/articles/getting_started_with_autotest">autotest</a>. (I&#8217;m not sure, but it looks like it has become <a href="http://www.nateclark.com/articles/2008/09/17/_autotest_-is-now-_autospec_-how-to-set-up-autospec-for-rspec-and-rails-with-zentest">autospec</a>.)</p>
<p>Not being a Ruby developer, I wanted the same thing for .NET. I did some searching, but my Google-fu failed me so I spent an hour hacking together my own.</p>
<p>The result is called <a href="http://github.com/jdiamond/autorunner">AutoRunner</a> (I know&#8211;way creative) and its source is available on GitHub.</p>
<p>If you want it, you have to download the source and compile it yourself for now. (UPDATE: You can now download it <a href="http://github.com/jdiamond/autorunner/downloads">here</a>!) Run it from your favorite console (PowerShell, right?) without any arguments to see what options it accepts.</p>
<p>AutoRunner is a little more general purpose than autotest/autospec is. Basically, it can run any executable when any file changes.</p>
<p>What I wanted it for was to run nunit-console.exe whenever my current tests assembly was rebuilt. To do that, I just invoke it with the right arguments.</p>
<p>If you have <a href="http://www.growlforwindows.com/">Growl for Windows</a> running, it will send it a notification which is pure eye candy and not necessary to actually get it to run your tests.</p>
<p>It&#8217;s not a Visual Studio add-in. It&#8217;s just a plain old console application. Using Visual Studio&#8217;s External Tools feature, however, it&#8217;s almost as good as an add-in. I set up an external tool with the appropriate arguments and it&#8217;s good to go for all of my projects.</p>
<p>To set this up for yourself, you&#8217;d create a new external tool with its command set to the path where you built AutoRunner.exe and its arguments set to something like the following (I&#8217;ve separated the options on their own lines, but you wouldn&#8217;t do that in Visual Studio):</p>
<pre>--target $(BinDir)\$(TargetName)$(TargetExt)
--exe C:\path\to\nunit-console.exe
--pass "$(TargetName) FTW!"
--fail "Oh noes! $(TargetName) is FAIL!"</pre>
<p>You can use whatever test runner you like, of course. Please note that you must have a file from your tests project open or selected in Solution Explorer when you activate the tool or your AutoRunner instance will be watching the wrong DLL!</p>
<p>It doesn&#8217;t support plug-ins the way autotest does and most of its functionality is hard-coded for now. If anybody finds it useful, let me know and maybe we can work on improving it together.</p>
]]></content:encoded>
			<wfw:commentRss>http://jason.diamond.name/weblog/2009/09/27/autorunner/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SharpTestsEx</title>
		<link>http://jason.diamond.name/weblog/2009/09/26/sharptestsex/</link>
		<comments>http://jason.diamond.name/weblog/2009/09/26/sharptestsex/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 23:12:10 +0000</pubDate>
		<dc:creator>Jason Diamond</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[BDD]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://jason.diamond.name/weblog/?p=61</guid>
		<description><![CDATA[I&#8217;ve been using Fabio Maulo&#8216;s NUnitEx project to get fluent assertions on a personal project recently and have been loving it. He then went and moved on to a new project called SharpTestsEx, which he intended to be framework-agnostic, but currently only worked with MSTest which prevented me from being able to use it (since [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://fabiomaulo.blogspot.com/">Fabio Maulo</a>&#8216;s <a href="http://code.google.com/p/nunitex/">NUnitEx</a> project to get fluent assertions on a personal project recently and have been loving it.</p>
<p>He then went and moved on to a new project called <a href="http://sharptestex.codeplex.com/">SharpTestsEx</a>, which he intended to be framework-agnostic, but currently only worked with MSTest which prevented me from being able to use it (since I never saw a compelling reason to switch to MSTest).</p>
<p>Fabio was kind enough to let me make the changes necessary to remove the dependency on MSTest. A also made framework-specific versions of SharpTestsEx for MSTest, NUnit, and xUnit. The framework-specific versions aren&#8217;t really necessary, but they make the error messages a tiny bit prettier if you use the right one for the test framework you&#8217;re using.</p>
<p>You can read Fabio&#8217;s announcement <a href="http://fabiomaulo.blogspot.com/2009/09/sharp-tests-ex-030-fluent-and-lambda.html">here</a>.</p>
<p>I plan on updating my personal project to using SharpTestsEx next.</p>
<p>I just realized I never posted about that project; I&#8217;ll have to get around to that soon. If you&#8217;re curious, it&#8217;s a <a href="http://dannorth.net/introducing-bdd">behaviour-driven development</a> framework for .NET called <a href="http://code.google.com/p/behaven/">BehaveN</a>. I&#8217;m using it at my work and we&#8217;re loving it.</p>
]]></content:encoded>
			<wfw:commentRss>http://jason.diamond.name/weblog/2009/09/26/sharptestsex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nesting NHibernate Mapping Files</title>
		<link>http://jason.diamond.name/weblog/2009/09/07/nesting-nhibernate-mapping-files/</link>
		<comments>http://jason.diamond.name/weblog/2009/09/07/nesting-nhibernate-mapping-files/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 06:07:17 +0000</pubDate>
		<dc:creator>Jason Diamond</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[NHibernate]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://jason.diamond.name/weblog/?p=51</guid>
		<description><![CDATA[The problem: Hiding Your hbm.xml files in Visual Studio (or not) The solution: How to nest NHibernate mapping files in Visual Studio projects I&#8217;m doing this in Visual Studio 2008. I don&#8217;t know if this is a &#8220;bug&#8221; or not, but it sure is annoying. The fix Timo posted does work, but it requires editing [...]]]></description>
			<content:encoded><![CDATA[<p>The problem: <a href="http://www.primedigit.com/2008/04/08/hiding-your-hbmxml-files-in-visual-studio-or-not/">Hiding Your hbm.xml files in Visual Studio (or not)</a></p>
<p>The solution: <a href="http://theiterator.com/2009/02/how-to-nest-nhibernate-mapping-files-in-visual-studio-projects/">How to nest NHibernate mapping files in Visual Studio projects</a></p>
<p>I&#8217;m doing this in Visual Studio 2008. I don&#8217;t know if this is a &#8220;bug&#8221; or not, but it sure is annoying. The fix Timo posted does work, but it requires editing your .csproj file by hand which is both tedious and error-prone.</p>
]]></content:encoded>
			<wfw:commentRss>http://jason.diamond.name/weblog/2009/09/07/nesting-nhibernate-mapping-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TestDriven.NET Keyboard Shortcuts</title>
		<link>http://jason.diamond.name/weblog/2009/09/04/testdriven-dot-net-keyboard-shortcuts/</link>
		<comments>http://jason.diamond.name/weblog/2009/09/04/testdriven-dot-net-keyboard-shortcuts/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 20:57:21 +0000</pubDate>
		<dc:creator>Jason Diamond</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://jason.diamond.name/weblog/?p=44</guid>
		<description><![CDATA[I&#8217;m so sick of Ctrl+Tab&#8217;ing back to my test file, finding the test I want to run, right-clicking it with the mouse, and selecting Run Test(s) or Test With. How come nobody told me that TestDriven.NET came with keyboard shortcuts? They have to be manually mapped, but once I did that, I&#8217;ve found them indispensible. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m so sick of Ctrl+Tab&#8217;ing back to my test file, finding the test I want to run, right-clicking it with the mouse, and selecting Run Test(s) or Test With.</p>
<p>How come nobody told me that <a href="http://www.testdriven.net/">TestDriven.NET</a> came with keyboard shortcuts? They have to be manually mapped, but once I did that, I&#8217;ve found them indispensible.</p>
<ul>
<li>Alt+1 : TestDriven.NET.RunTests</li>
<li>Alt+2 : TestDriven.NET.RerunWithDefault</li>
<li>Alt+3 : TestDriven.NET.Debugger</li>
<li>Alt+4 : TestDriven.NET.RerunWithDebugger</li>
</ul>
<p>I especially love the two shortcuts that repeat the most recent test run for me. Yeah, I know you can right-click in any file and select Repeat Test Run, but if I want to alternate between running inside or outside the debugger, I have to go find the test again. With my shortcuts, I can just hit Alt+2 or Alt+4 no matter where I am.</p>
]]></content:encoded>
			<wfw:commentRss>http://jason.diamond.name/weblog/2009/09/04/testdriven-dot-net-keyboard-shortcuts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Splitting CamelCase With Regular Expressions</title>
		<link>http://jason.diamond.name/weblog/2009/08/15/splitting-camelcase-with-regular-expressions/</link>
		<comments>http://jason.diamond.name/weblog/2009/08/15/splitting-camelcase-with-regular-expressions/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 22:22:40 +0000</pubDate>
		<dc:creator>Jason Diamond</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://jason.diamond.name/weblog/?p=27</guid>
		<description><![CDATA[On my new project, I needed to split a method name up into its constituent parts. For Ruby programmers, this is easy: just split on underscores. For us .NET programmers, we need something a little fancier since we like to SquashOurMethodNamesTogetherLikeThis. Here&#8217;s a little regular expression that can do exactly that: (?&#60;!^)(?=[A-Z]) That basically says [...]]]></description>
			<content:encoded><![CDATA[<p>On my new project, I needed to split a method name up into its constituent parts.</p>
<p>For Ruby programmers, this is easy: just split on underscores. For us .NET programmers, we need something a little fancier since we like to <code>SquashOurMethodNamesTogetherLikeThis</code>.</p>
<p>Here&#8217;s a little regular expression that can do exactly that:</p>
<pre>(?&lt;!^)(?=[A-Z])</pre>
<p>That basically says to match right before every capital letter unless the capital letter is at the beginning of the string.</p>
<p>You can use the Regex.Split method to do the actual work of turning the method name into a string array:</p>
<pre class="brush:csharp">
Regex splitter = new Regex(@"(?&lt;!^)(?=[A-Z])");
string[] words = splitter.Split(methodName);
</pre>
<p>My friend, <a href="http://www.michaelckennedy.net/">Michael Kennedy</a>, demoed in class recently how to use <a href="http://www.linqpad.net/">LINQPad</a> to test regular expressions. It came in really handy while working on this:</p>
<p><img src="http://jason.diamond.name/weblog/wp-content/uploads/2009/08/linqpad-with-regex.png" alt="linqpad-with-regex" title="linqpad-with-regex" width="667" height="362" class="alignnone size-full wp-image-32" /></p>
<p>I really need to click that &#8220;Activate Autocompletion&#8221; button so I can give <a href="http://www.albahari.com/">Joseph Albahari</a> the money he deserves for creating such a useful tool.</p>
<p>By the way, I used to think that &#8220;camel case&#8221; was for words like &#8220;camelCase&#8221; and &#8220;pascal case&#8221; was for words like &#8220;PascalCase&#8221;, but <a href="http://en.wikipedia.org/wiki/PascalCase">Wikipedia</a> doesn&#8217;t make that distinction.</p>
]]></content:encoded>
			<wfw:commentRss>http://jason.diamond.name/weblog/2009/08/15/splitting-camelcase-with-regular-expressions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My UnWordify Extension Method</title>
		<link>http://jason.diamond.name/weblog/2009/08/09/my-unwordify-extension-method/</link>
		<comments>http://jason.diamond.name/weblog/2009/08/09/my-unwordify-extension-method/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 04:41:55 +0000</pubDate>
		<dc:creator>Jason Diamond</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://jason.diamond.name/weblog/?p=8</guid>
		<description><![CDATA[Tim Barcz is looking for a solution to an interesting problem in his Coding Contest: Create a Programming Pearl post. I decided to challenge myself by writing my solution as a single &#8220;line&#8221; of code: public static class StringExtensions { private static Dictionary&#60;char, char> _charMap = new Dictionary&#60;char, char> { { (char)8208, (char)45 }, { [...]]]></description>
			<content:encoded><![CDATA[<p>Tim Barcz is looking for a solution to an interesting problem in his <a href="http://devlicio.us/blogs/tim_barcz/archive/2009/08/09/coding-contest-create-a-programming-pearl.aspx">Coding Contest: Create a Programming Pearl</a> post.</p>
<p>I decided to challenge myself by writing my solution as a single &#8220;line&#8221; of code:</p>
<pre class="brush:csharp">public static class StringExtensions
{
    private static Dictionary&lt;char, char> _charMap = new Dictionary&lt;char, char>
    {
        { (char)8208,  (char)45 },
        { (char)8211,  (char)45 },
        { (char)8212,  (char)45 },
        { (char)8722,  (char)45 },
        { (char)173,   (char)45 },
        { (char)8209,  (char)45 },
        { (char)8259,  (char)45 },
        { (char)96,    (char)39 },
        { (char)8216,  (char)39 },
        { (char)8217,  (char)39 },
        { (char)8242,  (char)39 },
        { (char)769,   (char)39 },
        { (char)768,   (char)39 },
        { (char)8220,  (char)34 },
        { (char)8221,  (char)34 },
        { (char)8243,  (char)34 },
        { (char)12291, (char)34 },
        { (char)160,   (char)32 },
        { (char)8195,  (char)32 },
        { (char)8194,  (char)32 }
    };

    public static string UnWordify(this string value)
    {
        return new string((from c in value
                           select _charMap.ContainsKey(c) ? _charMap[c] : c)
                          .ToArray());
    }
}</pre>
<p>OK, so I cheated and used a dictionary to create my map from the bad characters to the good ones, but the actual method <em>is</em> a single statement.</p>
]]></content:encoded>
			<wfw:commentRss>http://jason.diamond.name/weblog/2009/08/09/my-unwordify-extension-method/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
