문제

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?

올바른 솔루션이 없습니다

다른 팁

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 );
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top