views:

198

answers:

1

Ok I'm having a crisis of conscience right now.

I am having no luck in trying to abstract out RIA Services from our Silverlight application so we can do proper unit testing.

At this point we have a views and view models, and DomainContext is the Model. No matter how much we tried we cannot find anyway to abstract the DomainContext or the Entities so we can replace them with test data.

What is the recommended strategies to unit test a view model that has a dependency on RIA Services?

+2  A: 

Did you see my blog post that demonstrated exactly this? Specifically it allows you to plug in a mock DomainClient underneath the DomainContext, that then allows you to unit test your view models using a DomainContext without a dependency on any server.

http://www.nikhilk.net/NET-RIA-Services-ViewModel-Pattern-2.aspx

NikhilK