开发者

Unit Testing RIA Services

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 cod开发者_JS百科e, 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜