How can we improve WCF Data Services?

DataServiceCollection Mock/Stub support

Allow for the mocking / stubbing of the DataServiceCollection and context. All the constructors are internal. It would be nice if they all had interfaces that could be easily stubbed out.

348 votes
Sign in
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Natificent shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →


Sign in
Sign in with: facebook google
Signed in as (Sign out)
  • Niraj Jain commented  ·   ·  Flag as inappropriate

    Definitely Interface implementation is required for DataServiceContext and DataServiceQuery as without this it is very difficult to test the service implementation with client. I spend so much time using some mock frameworks but was unable to do so.

    Or please proved some code snippet if the developer can create interface themselves and use it for testing purpose.

  • Anonymous commented  ·   ·  Flag as inappropriate

    An interface to all functions provided by DataServiceQuery (and DataServiceContext) is necessary to write testable applications.

  • Edwin Klesman commented  ·   ·  Flag as inappropriate

    make it so, we really would love to be able to test our controllers that interact with webservices using mocks for dataservicecollection

  • MikeJ commented  ·   ·  Flag as inappropriate

    This is a great idea! I am really surprised Microsoft has not already started working on it.

Feedback and Knowledge Base