views:

90

answers:

1

Hi All,

I have a domain services class that runs on the server in a silverlight application. I.e. the class is defined like this,

public class UpgradeToolDomainService : DomainService
{
...
}

I am using RIA services which means that on the client it generates code which looks like this,

public sealed partial class UpgradeToolDomainContext : DomainContext
{
...
}

The problem with that is I would like to mock the UpgradeToolDomainContext using Rhino mocks when unit testing my client side code, but the class is sealed and Rhino mocks doesn't support mocking sealed classes.

What do you think?? I.e. is it possible to change the generated code to not be sealed? Or any other obvious solution?

+1  A: 

For the moment what I have done is create a partial class UpgradeToolDomainContext. I have made this class implement an interface. I am using this interface to create my mocks with.

Any better suggestions are welcome.

peter
This is not a great solution, and at the end of the day doesn't work. I found this here which is what I am trying to get running at the moment http://www.nikhilk.net/NET-RIA-Services-ViewModel-Pattern-2.aspx
peter