This project is read-only.

Is this available for Silverlight?

May 26, 2010 at 9:26 AM

Hi.

StoryQ looks great. How can I use it with Silverlight 3?

Thanks

Michael

May 26, 2010 at 10:22 AM
Michael, I can't answer the specifics of this - Rob will be able to though. However, I can outline an overall strategy of how StoryQ might fit into the picture. First, StoryQ won't help you specifically with testing any framework. Be it Silverlight, Asp.net, winforms. It is a wrapper for helping describe the intention or behaviour of the system under test. Put differently it is an abstraction layer which uses other test runners. So, the question first is what test runners do you have to use with Silverlight and can these leveraged with StoryQ? This leads to much more complicated answers that I have talked about in posts about test automation pyramid [http://blog.goneopen.com/2010/03/test-automation-pyramid-asp-net-mvc/]. So, personally, I find StoryQ's sweet spot is testing at the system level of workflow. It is most useful because it requires that you create good levels of design that abstract in DDD terms the UI layer from the application layer. Doing it this way, the StoryQ tests are actually code at the UI layer which invoke the application layer. These are akin to the Silverlight code which is the UI layer. In this model, which I discuss in the link above, you assure layering by having two clients of the application layer - the tests and the UI. This approach may not be what you are looking for. Often people have a lot of business logic implicitly in the UI layer making this nigh impossible - I use it therefore to keep myself honest! The other way is to use it more in a FIT/Fitnesse (or NUnit) fashion say with Selenium. This approach specifies "data"/scenarios that pass through to the selenium runner that runs the browser. In this case, you would need a runner that can invoke the Silverlight application. I tend to use this approach for smoke testing but not with StoryQ (or Fitnesse or nUnit) because it is actually very costly over time. Does that help? Todd
May 26, 2010 at 1:52 PM

Hi Michael

What test runner, and what version of VS?

Regards - Rob

May 27, 2010 at 9:12 AM

Todd / Rob,

Thanks for the replies. Sorry for not getting back to you yesterday.

I'm using VS 2008 Pro, NUnit 2.5.5, Jeremy Cansdale’s SilverlightNUnitProject template, Silverlight 3, Silverlight Unit Test Framework (Slut!) from the Nov 09 Silverlight Toolkit.

I also use ReSharper 5 and its test runner when running tests from with the IDE.

My initial question really was about getting a copy of StoryQ.dll compiled for Silverlight 3!

I naively thought that I could then just create my NUnit tests as usual, add the reference to StoryQ.dll and bob’s your uncle!

Am I missing something?

Thanks for your help.

Michael

 

 

 

May 27, 2010 at 9:45 AM

Hi Michael

Thanks for the info

have you had a chance to download our source and try to compile it under silverlight? (http://storyq.codeplex.com/SourceControl/changeset/changes/e2167813c260, click on download)

I am very interested to find out if this works, but won't have time to check it myself as quickly as you will be able to, since you've obviously got your dev environment set up...

I think it should work :)

Regards - Rob

Oct 28, 2010 at 5:44 PM

Rob

Sorry for not getting back to you for ages!

Tried downloading and compiling for Silverlight 4 but gave up as it was too complex: StoryQ depends on Flit which depends on Irony. Each one requires building with SL4.

So I remembered this 'hack'. Here are my notes to the rest of the team:

StoryQ is a single DLL that allows a developer to express tests in BDD (Behaviour Driven Development) form.
The developer still continues to use NUnit, but each test method will now contain StoryQ calls.
See http://storyq.codeplex.com/

The StoryQ.dll we have in 3rdParty is compiled against the .NET 3.5 Framework - not Silverlight.
That means that from a Silverlight project, VS will not allow you to add a reference to it 
interactively (from within the IDE).
However, you can do it manually by following the steps below.

In the VS 2010 IDE:

1. Unload your DEV / TEST project (right click > Unload project)
2. Edit it (right click > edit)
3. Add these references to the other references:
   
    <Reference Include="StoryQ">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\3rdParty\StoryQ\Net\StoryQ.dll</HintPath>
    </Reference>
    
4. Reload the project (right click > reload)

Note that ATM (October 2010) ReSharper 5.1 inserts some squiggles into the editor - ignore them for now
as the code will compile and run happily.

 

I have done this and am using it happily with NUnit 2.5.5.

Cheers

Michael

PS. You can use exactly the same technique with NUnit:

In the IDE:

1. Unload your project
2. Edit it.
3. Add this reference to the other references:
   
    <Reference Include="NUnit.Framework">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\3rdParty\NUnit\Silverlight\NUnit.Framework.dll</HintPath>
    </Reference>

4. Reload the project.