Pergunta

I trying to figure out how to mole the

Microsoft.Practices.SharePoint.Common.ServiceLocation.SharePointServiceLocator.GetCurrentFarmLocator

because I trying to use

 Microsoft.Practices.SharePoint.Common.Logging.SharePointLogger.WriteToDeveloperTrace

some help or example?

Nenhuma solução correta

Outras dicas

I found a solution by myself using the SharePointServiceLocator. Basically I implemented this on my code:

            var replaceLocator = new ActivatingServiceLocator ( );
            SharePointServiceLocator.ReplaceCurrentServiceLocator ( replaceLocator );
            replaceLocator.RegisterTypeMapping < ILogger, MockLogger > ( InstantiationType.AsSingleton );
            replaceLocator.RegisterTypeMapping < ITraceLogger, MockLogger > ( InstantiationType.AsSingleton );
            replaceLocator.RegisterTypeMapping < IEventLogLogger, MockLogger > ( InstantiationType.AsSingleton );
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top