I am trying to use RhinoMock to bully a wcf service.
Let's say I have the following service:
[OperationContract] List<User> SearchUsers(UserSearchFilter filter);
Adding this service to Visual Studio will create a proxy server, and this proxy server has an interface:
public interface ResourceService { System.IAsyncResult BeginSearchUsers(UserSearchFilter filter, System.AsyncCallback callback, object asyncState); ObservableCollection<User> EndSearchUsers(System.IAsyncResult result); }
Then I create a ViewModel that uses this service, for example:
private ResourceService service; public ViewModelBase(ResourceService serv) { service = serv; var filter = new UserSearchFilter(); service.BeginSearchUsers(filter, a => { this.Users = service.EndSearchUsers(a); }, null); }
Then the question arises. How do I trick this service using RhinoMock?
[TestMethod] public void UserGetsPopulatedOnCreationOfViewModel() {
I am really happy if someone can help me with the proper use of RhinoMock
(Note: I am using Silverlight, but I do not think this will change the way RhinoMock is used)
Thanks a lot!
source share