Como fazer mock do cliente WCF usando o Moq?

No meu projeto estou usando: SL5 + MVVM + Prisma + WCF + Rx + Moq + Silverlight Testing Framework Unitário.

Eu sou novo em testes unitários e comecei recentemente em DI, Patterns (MVVM), etc. Por isso, o código a seguir tem muito espaço para melhorias (por favor, fique à vontade para rejeitar toda a abordagem que estou tomando, se você pensa assim).

Para acessar meus serviços WCF, eu criei uma classe de fábrica como abaixo (novamente, pode ser falho, mas por favor dê uma olhada):

namespace SomeSolution
{
    public class ServiceClientFactory:IServiceClientFactory
    {
        public CourseServiceClient GetCourseServiceClient()
        {
            var client = new CourseServiceClient();
            client.ChannelFactory.Faulted += (s, e) => client.Abort();
            if(client.State== CommunicationState.Closed){client.InnerChannel.Open();}
            return client;
        }

        public ConfigServiceClient GetConfigServiceClient()
        {
            var client = new ConfigServiceClient();
            client.ChannelFactory.Faulted += (s, e) => client.Abort();
            if (client.State == CommunicationState.Closed) { client.InnerChannel.Open(); }
            return client;
        }

        public ContactServiceClient GetContactServiceClient()
        {
            var client = new ContactServiceClient();
            client.ChannelFactory.Faulted += (s, e) => client.Abort();
            if (client.State == CommunicationState.Closed) { client.InnerChannel.Open(); }
            return client;
        }
    }
}

Ele implementa uma interface simples como abaixo:

public interface IServiceClientFactory
{
    CourseServiceClient GetCourseServiceClient();
    ConfigServiceClient GetConfigServiceClient();
    ContactServiceClient GetContactServiceClient();
}

Em minhas VMs, estou fazendo a DI da classe acima e usando o Rx para chamar o WCF, conforme abaixo:

var client = _serviceClientFactory.GetContactServiceClient();
try
{

    IObservable<IEvent<GetContactByIdCompletedEventArgs>> observable =
        Observable.FromEvent<GetContactByIdCompletedEventArgs>(client, "GetContactByIdCompleted").Take(1);

    observable.Subscribe(
        e =>
            {
                if (e.EventArgs.Error == null)
                {                                    
                    //some code here that needs to be unit-tested

                }
            },
        ex =>
        {
            _errorLogger.ProcessError(GetType().Name, MethodBase.GetCurrentMethod().Name, ErrorSource.Observable, "", -1, ex);
        }
        );
    client.GetContactByIdAsync(contactid, UserInformation.SecurityToken);
}
catch (Exception ex)
{
    _errorLogger.ProcessError(GetType().Name, MethodBase.GetCurrentMethod().Name, ErrorSource.Code, "", -1, ex);
}

Agora eu quero construir testes unitários (sim, não é TDD). Mas eu não entendo por onde começar. Com Moq não posso zombar do BlahServiceClient. Além disso, nenhuma interface gerada por svcutil pode ajudar, porque os métodos assíncronos não fazem parte da interface IBlahService gerada automaticamente. Eu posso preferir estender (através de classes parciais, etc) qualquer uma das classes geradas automaticamente, mas eu odiaria optar por construir manualmente todo o código que o svcutil pode gerar (francamente considerando tempo e orçamento).

Alguém pode ajudar por favor? Qualquer ponteiro na direção certa me ajudaria muito.

questionAnswers(1)

yourAnswerToTheQuestion