Esempio n. 1
0
 private void AssertLogData(MockEventLogger logger, EventLogEntryType severity)
 {
     Assert.AreEqual("Message", logger.Message);
     Assert.AreEqual("Category1", logger.Category);
     Assert.AreEqual(99, logger.EventID);
     Assert.AreEqual(severity, logger.Severity);
 }
Esempio n. 2
0
        public void TestInitialize()
        {
            SharePointServiceLocator.ReplaceCurrentServiceLocator(new ActivatingServiceLocator()
                                                                  .RegisterTypeMapping <ITraceLogger, MockTraceLogger>(InstantiationType.AsSingleton)
                                                                  .RegisterTypeMapping <IEventLogLogger, MockEventLogger>(InstantiationType.AsSingleton));

            traceLogger = SharePointServiceLocator.Current.GetInstance <ITraceLogger>() as MockTraceLogger;
            eventLogger = SharePointServiceLocator.Current.GetInstance <IEventLogLogger>() as MockEventLogger;
        }