Q:

RhinoMock help: Mocking WCF service

I'm trying to use RhinoMock for mocking out a wcf service.
Say I have the following service:
    [OperationContract]
    List<User> SearchUsers(UserSearchFilter filter);

Adding this service with Visual Studio will generate a proxy, and that proxy has a Interface like:
 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, like this:
        private ResourceService service;
    public ViewModelBase(ResourceService serv)
    {
        service = serv;
        var filter = new UserSearchFilter();
        service.BeginSearchUsers(filter, a =>
        {
            this.Users = service.EndSearchUsers(a); 
        }, null);
    }

Then comes the question. How do I mock this service using RhinoMock? 
       [TestMethod]
    public void UserGetsPopulatedOnCreationOfViewModel()
    {
        // Is stub the right thing to use?
        ResourceService serv = MockRepository.GenerateStub<ResourceService>();

        // Do some setup... Don't know how?
        var vm = new ViewModel(serv);

        Assert.IsTrue(vm.Users.Count > 0);
    }

I be really happy if someone could help me with the correct usage of RhinoMock
(Note: I'm using Silverlight, but I don't think that would change the way RhinoMock is used)
Thanks a lot!

A:

I wrote a 4-part article all about testing apps that use WCF services.
Part 2 talks about mocking out the service using RhinoMocks
Part 3 talks about mocking out an asynchronous service using Moq
Note that part 3 can be translated over to RhinoMocks very easily.  I was just trying to show different mocking frameworks, and that the technique did not rely on the mocking framework.
Hope it helps!
EDIT
So, in Rhino Mocks, you do this in the setup:
mockService.YourEvent += null;
IEventRaiser loadRaiser = LastCall.IgnoreArguments().GetEventRaiser();

Then in the playback, you do this:
loadRaiser.Raise(mockService, CreateEventArgs());

You can find more info on mocking events in Rhino in Phil Haack's blog post.

