<?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>Marc Dormey &#187; storyq</title>
	<atom:link href="http://www.marcdormey.com/index.php/tags/storyq/feed" rel="self" type="application/rss+xml" />
	<link>http://www.marcdormey.com</link>
	<description>Software Finds, Programming Tutorials and Gadget Reviews</description>
	<lastBuildDate>Tue, 20 Jul 2010 14:52:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Writing Facebook Apps with ASP.NET MVC, Silverlight, LINQ2Facebook and BDD</title>
		<link>http://www.marcdormey.com/index.php/archives/writing-facebook-apps-with-asp-net-mvc-silverlight-linq2facebook-and-bdd</link>
		<comments>http://www.marcdormey.com/index.php/archives/writing-facebook-apps-with-asp-net-mvc-silverlight-linq2facebook-and-bdd#comments</comments>
		<pubDate>Tue, 10 Nov 2009 11:19:19 +0000</pubDate>
		<dc:creator>Marcel</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[bdd]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[linq2facebook]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[storyq]]></category>

		<guid isPermaLink="false">http://www.marcdormey.com/?p=269</guid>
		<description><![CDATA[This weekend I looked into creating facebook applications from a .NET perspective. It turns out a quick search presents loads of support starting with the Facebook Developer Toolkit (Update: Just heard version 3 was released yesterday which gives silverlight and mvc support, wow what a coincidence?) and LINQ2Facebook (Fql).
I decided to do some research and [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend I looked into creating facebook applications from a .NET perspective. It turns out a quick search presents loads of support starting with the <a href="http://wiki.developers.facebook.com/index.php/C" target="_blank">Facebook Developer Toolkit</a> (Update: Just heard version 3 was released yesterday which gives silverlight and mvc support, wow what a coincidence?) and <a href="http://www.codeproject.com/KB/aspnet/LinqToFqlAddon.aspx" target="_blank">LINQ2Facebook</a> (Fql).</p>
<p>I decided to do some research and ended up created a Facebook application framework using ASP.NET MVC, Silverlight, LINQ2Facebook. I also used <a href="http://www.codeplex.com/storyq" target="_blank">StoryQ</a> to POC their BDD framework and give the community a chance to see its power.</p>
<p>I have created a codeplex project with the source code here:</p>
<p><a href="http://facebookmvcbdd.codeplex.com/" target="_blank">Facebook MVC BDD Silverlight Framework</a></p>
<p>Source code sample:</p>
<pre class="brush:csharp">
public ActionResult Index()
{
	if (_service.TryAuthenticating())
	{
		user user = _service.GetCurrentUser();
		var silverlightViewModel = new SilverlightViewModel
									   {
										   ApplicatonName = "TestApp",
										   Width = "400",
										   Height = "400"
									   };

		silverlightViewModel.Params.Add("Name", user.name);
		silverlightViewModel.Params.Add("Picture", user.pic_big);

		return View(silverlightViewModel);
	}
	throw new AuthenticationException("Not allowed!");
}
</pre>
<pre class="brush:csharp">
[Test]
public void IndexActionShouldReturnViewModelWithCurrentLoggedInUser()
{
    var story = new Story("Index action should return a new silverlight view model");

    story.AsA("facebook application home page")
        .IWant("to receive a new silverlight view model")
        .SoThat("I can send it to the silverlight applicatioin")
        .WithScenario("Get silverlight view model")
        .Given(() => Steps.TheUserIsLoggedInWithUsername("Joe Blogs"))
        .When(() => Steps.TheUserEntersTheHomePage())
        .Then(() => Steps.EnsureTheCurrentLoggedInUserDetailsIsReceivedInTheViewModel());

    story.Assert();
}
</pre>
<p>producing output:</p>
<p>Story: Index action should return a new silverlight view model</p>
<p>  As a facebook application home page<br />
  I want to receive a new silverlight view model<br />
  So that I can send it to the silverlight applicatioin</p>
<p>  Scenario 1: Get silverlight view model<br />
    Given The user is logged in with username (Joe Blogs)                          Passed<br />
    When The user enters the home page                                             Passed<br />
    Then Ensure the current logged in user details is received in the view model   Passed</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcdormey.com/index.php/archives/writing-facebook-apps-with-asp-net-mvc-silverlight-linq2facebook-and-bdd/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Behaviour Driven Development in NUnit with StoryQ</title>
		<link>http://www.marcdormey.com/index.php/archives/behaviour-driven-development-in-nunit-with-storyq</link>
		<comments>http://www.marcdormey.com/index.php/archives/behaviour-driven-development-in-nunit-with-storyq#comments</comments>
		<pubDate>Tue, 22 Sep 2009 11:38:41 +0000</pubDate>
		<dc:creator>Marcel</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[bdd]]></category>
		<category><![CDATA[behaviour driven development]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[mspec]]></category>
		<category><![CDATA[nbehave]]></category>
		<category><![CDATA[resharper]]></category>
		<category><![CDATA[specifications]]></category>
		<category><![CDATA[storyq]]></category>
		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://www.marcdormey.com/?p=178</guid>
		<description><![CDATA[A few months ago I started with BDD (Behaviour Driven Development). The first thing I noticed with most frameworks (MSpec, NBehave) is that you either need a new test runner tool (Galio) or need quite a bit of tweaking to implement the respective framework with Test-Driven.NET or Resharper&#8217;s test runner (Galio has a Resharper plugin). [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago I started with BDD (Behaviour Driven Development). The first thing I noticed with most frameworks (MSpec, NBehave) is that you either need a new test runner tool (<a href="http://www.gallio.org/" target="_blank">Galio</a>) or need quite a bit of tweaking to implement the respective framework with <a href="http://www.testdriven.net/" target="_blank">Test-Driven.NET</a> or <a href="http://www.jetbrains.com/resharper/" target="_blank">Resharper</a>&#8217;s test runner (Galio has a Resharper plugin). </p>
<p>This isn&#8217;t a problem in most cases, but what if you need to run these tests on Team-City or Cruise-Control? Now the complexity of the tweaking starts to become quite a different ball game!</p>
<p>Luckily there is an open-source tool called <a href="http://www.codeplex.com/storyq" target="_blank">StoryQ</a> which runs on NUnit and doesnt require any tweaking. The developer can run this with his usual test-runner tool and best of all, nothing has to change on the Buildserver.</p>
<p>Besides requiring no tweaking, StoryQ is a pretty competitive BDD tool altogether and provides loads of nifty features.</p>
<p>The idea is that &#8220;Tests&#8221; should be viewed as &#8220;Specs&#8221;, because this removes much of the confusion of TDD especially for beginners.<br />
Your typical Unit test (or Spec) would look like this:</p>
<pre class="brush:csharp">
using NUnit.Framework;
using StoryQ.Framework;

  namespace StoryQ.Tests.Documentation
  {
    [TestFixture]
    public class SimpleDocumentationSpec
    {

        [Test]
        public void WritingSpecificationsToBegin()
        {
            Story story = new Story("writing executable specifications");

            story.AsA("business person")
                .IWant("to write executable specifications")
                .SoThat("a developer can implement them")

                .WithScenario("Writing specifications")
                    .Given("That i have written everything in text")
                    .When("the test is run")
                    .Then("the test result should be pending")

                .WithScenario("Writing specifications again")
                    .Given("That i have written everything in text")
                        .And("still have no asserts")
                        .And("and have another condition")
                    .When("the test is run")
                        .And("I am happy")
                    .Then("the test result should be pending")
                       .And("here's just some more and's");

            story.Assert();
        }

    }
  }
</pre>
<p>This would present an NUnit output result of:</p>
<pre class="brush:xml">
SimpleDocumentationSpec.WritingSpecificationsToBegin : IgnoredPending
Story: writing executable specifications

  As a business person
  I want to write executable specifications
  So that a developer can implement them

  Scenario 1: Writing specifications
    Given That i have written everything in text  *Pending
    When the test is run                          *Pending
    Then the test result should be pending        *Pending

  Scenario 2: Writing specifications again
    Given That i have written everything in text  *Pending
      And still have no asserts                   *Pending
      And and have another condition              *Pending
    When the test is run                          *Pending
      And I am happy                              *Pending
    Then the test result should be pending        *Pending
      And here's just some more and's             *Pending
</pre>
<p>You can then start adding functionality with the given scenarios like so:</p>
<pre class="brush:csharp">
using NUnit.Framework;
using StoryQ.Framework;

namespace StoryQ.Tests.Documentation
{
    [TestFixture]
    public class UsingNarrativesSpec
    {

        [Test]
        public void WritingExecutablePassingSpecificationsWithNarratives()
        {
            Story story = new Story("writing executable specifications");

            story.AsA("business person")
                .IWant("to write executable specifications")
                .SoThat("a developer can implement them")

                .WithScenario("Writing specifications again")
                    .Given(Narrative.Text("I have a narrative"))
                    .When(() => TheTestIs_("run"))
                    .Then(Narrative.Exec("this will now pass", passMe));

            story.Assert();
        }

        static void passMe()
        {
            Assert.IsTrue(true);
        }

        static void TheTestIs_(string s)
        {
            Assert.AreEqual(s, "run");
        }

    }
}
</pre>
<p>Which will give you the output of:</p>
<pre class="brush:csharp">
UsingActionsSpec.WritingExecutableSpecificationsAsActions : PassedStory: writing executable specifications

  As a business person
  I want to write executable specifications
  So that a developer can implement them

  Scenario 1: Writing specifications
    Given That i have written everything in text  *Pending
    When the test is run                          *Pending
    Then the test result should be pending        *Pending

  Scenario 2: Writing specifications again
    Given That everything isnt                     Passed
    When The test is run                           Passed
    Then the test result should be pending        *Pending
</pre>
<p>There are many more options and different ways to implement the scenarios on the <a href="http://www.codeplex.com/storyq" target="_blank">StoryQ home page</a>.<br />
Another great feature about StoryQ is to convert your english written stories into C# tests. Yes, you read that right! It will even write the code for you! By using convention that can be tought to your &#8220;Product Owners&#8221;, you can literally copy and paste their requirements to a tool which will present the generated c# test.</p>
<p><img alt="" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=storyq&#038;DownloadId=39599" title="StoryQ Converter" class="aligncenter" width="600" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcdormey.com/index.php/archives/behaviour-driven-development-in-nunit-with-storyq/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
