do { Engine.BlogAbout(".NET","Silverlight"); } while ( alive );  

Mark Monster

Mark Monster  

Thinking about Silverlight and Mocking

There are quite some Mocking frameworks available. But sadly no one is ported to Silverlight, yet. I know about the porting of NUnit to Silverlight, but while working on Unit tests for the "Silverlight Networking through Javascript" library I found out there’s no Mocking framework yet to support the Silverlight runtime.

I would like to see some support for Silverlight from either Moq or Rhino Mocks. That’s because I like the way those Mocking frameworks work. I think they both make use of Castle’s DynamicProxy, so that’s another thing that first needs to become Silverlight enabled.

I’m sure more people thought about Mocking in a Silverlight runtime but didn’t find a solution too. I’m interested if anyone started to port one of the above Mocking frameworks to Silverlight. I’m not even totally sure if it’s possible but at least a part of Reflection.Emit exists.

What are anyone’s thoughts about Mocking in Silverlight?

10 Responses to “Thinking about Silverlight and Mocking”

  1. Community Blogs Says:

    Silverlight Cream for July 28,2008 — #337

    Mark Monster on Mocking SL and Networking, Denislav Savkov inheriting from ItemsControl, Alex Golesh

  2. Menahem Cohen Says:

    Why dont you try Typemock?

  3. Mark Monster Says:

    I did look for support for Silverlight by TypeMock and couldn’t find it. Does TypeMock support Silverlight already? Maybe I will try it when Silverlight is supported.

  4. What needs to be done to make DynamicProxy work in Silverlight? » Mark Monster Says:

    [...] time ago I sort of complained there’s no Mocking Framework available for Silverlight. This has a lot to do with the not being available Castle’s DynamicProxy for Silverlight. So [...]

  5. Mocking and IOC in Silverlight 2, Castle Project and Moq ports Says:

    [...] Mark Monster blogged about what it would take to port Castle DynamicProxy and consequently Moq to Silverlight and so until someone comes along with a better or official solution I decided to take up the challenge. There was a fair amount of work, although in terms of actual code changes that were needed due to API changes in the Silverlight CLR there was really very little, the brunt of the work as Mark pointed out was around the lack of Remoting and also the lack of non-generic collections in Silverlight. I will just note though Mark, your list of code changes required to get these projects to compile is a MASSIVE underestimate, because the compiler shows as many errors as it can, but only when you fix these does it throw another few hundred at you! [...]

  6. Recent Links Tagged With "rhinomocks" - JabberTags Says:

    [...] Saved by nonyma on Thu 25-12-2008 The all positive post Saved by kingtone on Sun 21-12-2008 Thinking about Silverlight and Mocking Saved by cwilke1212 on Mon 15-12-2008 Don’t Expect a Call Saved by unixmind on Mon 15-12-2008 [...]

  7. Thomas Says:

    Last but not least, I recently applied a patch that made Castle.DynamicProxy 2 also available for Silverlight…

  8. Thomas Says:

    http://hammett.castleproject.org/?p=336

  9. Recent Faves Tagged With "unittesting" : MyNetFaves Says:

    [...] Usando Valores Aleatórios Para Testes Unitários First saved by KibaInozuka | 2 days ago Thinking about Silverlight and Mocking First saved by SlimShady007007 | 9 days ago Toolbox for Agile Projects and Developers @ [...]

  10. Alastair Says:

    Port of moq to Silverlight
    http://www.flawlesscode.com/post/2008/08/Mocking-and-IOC-in-Silverlight-2-Castle-Project-and-Moq-ports.aspx

    Port of Rhino Mocks to Silverlight:
    http://ayende.com/Blog/archive/2009/02/04/rhino-mocks-3.5-ndash-silverlight.aspx

Leave a Reply