<?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>Marcin Obel &#187; Testing</title>
	<atom:link href="http://marcinobel.com/index.php/tag/testing/feed/" rel="self" type="application/rss+xml" />
	<link>http://marcinobel.com</link>
	<description>.NET, ASP.NET MVC, jQuery, Ruby, Ruby on Rails, Test Driven Development, Agile</description>
	<lastBuildDate>Mon, 15 Aug 2011 12:53:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>C# 4.0 Named Arguments &#8211; example usage</title>
		<link>http://marcinobel.com/index.php/csharp-4-0-named-arguments-usage/</link>
		<comments>http://marcinobel.com/index.php/csharp-4-0-named-arguments-usage/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 18:06:57 +0000</pubDate>
		<dc:creator>Marcin Obel</dc:creator>
				<category><![CDATA[.Net Framework]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://marcinobel.com/?p=314</guid>
		<description><![CDATA[One of the new features introduced in C# 4.0 were named arguments. There was a lot of discussion in the Internet about them and theirs pros and cons. Of course named arguments can be abused like any other part of C# but I think that when used wisely are able to make your code more [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-21" title=".NET Logo" src="http://marcinobel.com/wp-content/uploads/2009/08/net_logo.png" alt="" width="240" height="74" />One of the new features introduced in C# 4.0 were <strong><a title="Named Arguments in C# 4.0" href="http://msdn.microsoft.com/en-us/library/dd264739.aspx" target="_blank">named arguments</a></strong>. There was a lot of discussion in the Internet about them and theirs pros and cons. Of course named arguments can be abused like any other part of C# but I think that when used wisely are able to make your code more readable and easier to understand without the knowledge what is hidden behind the scene. Few days ago I was working on integration tests for REST API exposed by a startup I am working on with my team. Each test required some &#8220;execution context&#8221; and a way to inform &#8220;infrastructure&#8221; that after execution whole environment should be cleaned up (e.g. database). Because I use NUnit as a runner the first idea that came to my mind was to utilize [SetUp] and [TearDown] methods. But after some prototyping I realized that the solution is hard to understand and obfuscates the tests. Next day after short chat with <a href="http://twitter.com/lesnikowski" target="_blank"><strong>@lesnikowski</strong></a> new idea popped into my mind: I can create &#8220;execution context&#8221; with lambdas and named arguments! The example below shows how I have changed the idea into real code.</p>
<pre class="brush: csharp; title: ; notranslate">
[Test]
public void Add_WhenInvokedShouldAddNewExternalAudioFolder()
{
    Execute(test: () =&gt;
    {
        var json = WebApiClient.ExternalAudioFolder.Add(&quot;My folder&quot;, &quot;My description&quot;);
        var message = json.DeserializeJson&lt;AddMessage&gt;();

        Assert.That(message.Result, Is.EqualTo(Message.Success));
    },
    inContextOf: Account.Basic,
    cleanUpAfter: true);
}
</pre>
<p>What do you think about the code above? Do you have any additional ideas how to improve readability of this &#8220;execution context&#8221;?</p>
]]></content:encoded>
			<wfw:commentRss>http://marcinobel.com/index.php/csharp-4-0-named-arguments-usage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MSpec BDD framework installer</title>
		<link>http://marcinobel.com/index.php/mspec-bdd-installer/</link>
		<comments>http://marcinobel.com/index.php/mspec-bdd-installer/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 11:23:35 +0000</pubDate>
		<dc:creator>Marcin Obel</dc:creator>
				<category><![CDATA[.Net Framework]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://marcinobel.com/?p=186</guid>
		<description><![CDATA[Installation of MSpec BDD framework from source code is quite annoying. With each release you have to deploy everything manually one more time what in fact is hard to accept in 21th century. I know that work on Open Source project requires a lot of time (I have my own project called ByteCarrot) and you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://marcinobel.com/wp-content/uploads/2009/08/net_logo.png"><img class="alignleft size-full wp-image-21" title=".NET Logo" src="http://marcinobel.com/wp-content/uploads/2009/08/net_logo.png" alt=".NET Logo" width="240" height="74" /></a>Installation of <strong>MSpec</strong> BDD framework from source code is quite annoying. With each release you have to deploy everything manually one more time what in fact is hard to accept in 21th century. I know that work on <strong>Open Source</strong> project requires a lot of time (I have my own project called <a title="ByteCarrot Project" href="http://bytecarrot.com" target="_blank"><strong>ByteCarrot</strong></a>) and you cannot do everything. Because of that I decided to help a little bit creators of <strong>MSpec </strong>and I have prepared an installer for this BDD framework. It is based on <strong>WiX </strong>and latest release of <strong>MSpec </strong>witch is version <strong>0.3</strong>.</p>
<p>The installer is able to automatically integrate <strong>MSpec</strong> with <strong>TestDriven.NET</strong> and <strong>ReSharper</strong> (4.1, 4.5, 5.0). This is first version of the installer and of course like always there can be some bugs so please let me know if you find something.</p>
<h2><a title="Download installer for MSpec 0.3" href="http://marcinobel.com/download/MSpec-0.3.msi" target="_self">Download installer for MSpec 0.3</a></h2>
]]></content:encoded>
			<wfw:commentRss>http://marcinobel.com/index.php/mspec-bdd-installer/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>ReSharper&#8217;s Live Templates for MSpec BDD framework</title>
		<link>http://marcinobel.com/index.php/resharpers-live-templates-for-mspec-bdd-framework/</link>
		<comments>http://marcinobel.com/index.php/resharpers-live-templates-for-mspec-bdd-framework/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 20:57:31 +0000</pubDate>
		<dc:creator>Marcin Obel</dc:creator>
				<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://marcinobel.com/?p=52</guid>
		<description><![CDATA[Few days ago Pawel Lesnikowski has blogged about his Live Templates for ReSharper. Because I think it is good idea to share such things with other developers I decided to show my Live Templates I have made to be able to create BDD specifications with MSpec faster. Here they are: specc &#8211; Short template for [...]]]></description>
			<content:encoded><![CDATA[<p>Few days ago <a href="http://www.lesnikowski.com/blog/" target="_blank">Pawel Lesnikowski</a> has blogged about <a href="http://www.lesnikowski.com/blog/index.php/2009/09/21/my-resharper-templates-for-unit-testing/" target="_blank">his Live Templates for ReSharper</a>. Because I think it is good idea to share such things with other developers I decided to show my <a href="http://www.jetbrains.com/resharper/features/code_templates.html#Live_Templates" target="_blank">Live Templates</a> I have made to be able to create BDD specifications with <a href="http://codebetter.com/blogs/aaron.jensen/" target="_blank">MSpec</a> faster. Here they are:</p>
<p><strong>specc</strong> &#8211; Short template for MSpec BDD context</p>
<pre class="brush: csharp; title: ; notranslate">
public abstract class with_$Context$
{
	Establish context = () =&gt;
	{
		$END$
	};
}
</pre>
<p><strong>specf</strong> &#8211; Full template for MSpec BDD specification</p>
<pre class="brush: csharp; title: ; notranslate">
[Subject(typeof($Subject$))]
public class when_$Specification$
{
	Establish context = () =&gt;
	{

	};

	Because of = () =&gt;
	{

	};

	It should_$Behaviour$;$END$
}
</pre>
<p><strong>specs</strong> &#8211; Short template for MSpec BDD specification</p>
<pre class="brush: csharp; title: ; notranslate">
[Subject(typeof($Subject$))]
public class when_$Specification$
{
	It should_$Behaviour$;$END$
}
</pre>
<p><strong>spect</strong> &#8211; Default template for MSpec BDD specification</p>
<pre class="brush: csharp; title: ; notranslate">
[Subject(typeof($Subject$))]
public class when_$Specification$ : with_$Context$
{
	Because of = () =&gt;
	{

	};

	It should_$Behaviour$;$END$
}
</pre>
<p>Here you can download definition of all mentioned templates which can be imported to your ReSharper: <a href="http://marcinobel.com/wp-content/uploads/2009/09/MSpec.LiveTemplates.xml">MSpec.LiveTemplates</a></p>
]]></content:encoded>
			<wfw:commentRss>http://marcinobel.com/index.php/resharpers-live-templates-for-mspec-bdd-framework/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

