예제 #1
0
        public void EventLogLoggerPropertyTest()
        {
            SharePointLogger logger = new SharePointLogger();

            try
            {
                IEventLogLogger iELogger = logger.EventLogLogger;
                EventLogLogger  elogger  = new EventLogLogger();
                if (!iELogger.GetType().IsInterface)
                {
                    if (iELogger.GetType().ToString() == elogger.GetType().ToString())
                    {
                        Assert.IsTrue(true);
                    }
                    else
                    {
                        Assert.Fail("There is a type mismatch");
                    }
                }
                else
                {
                    Assert.Fail("Interface was returned");
                }
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }
예제 #2
0
        public void EventLogLoggerPropertyTest2()
        {
            SharePointLogger logger   = new SharePointLogger();
            IEventLogLogger  iELogger = logger.EventLogLogger;
            EventLogLogger   elogger  = (EventLogLogger)logger.EventLogLogger;

            Assert.AreEqual(iELogger.GetType(), elogger.GetType());

            logger   = null;
            iELogger = null;
            elogger  = null;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="SPEventLogServiceLog"/> class.
 /// </summary>
 /// <param name="log">The log.</param>
 /// <param name="eventID">The event ID.</param>
 /// <param name="areaName">Name of the area.</param>
 /// <param name="category">The category.</param>
 public SPEventLogServiceLog(IEventLogLogger log, int eventID, string areaName, string category)
 {
     if (log == null)
     {
         throw new ArgumentNullException("log");
     }
     if (string.IsNullOrEmpty(areaName))
     {
         throw new ArgumentNullException("areaName");
     }
     if (string.IsNullOrEmpty(category))
     {
         throw new ArgumentNullException("category");
     }
     Log      = log;
     EventID  = eventID;
     AreaName = areaName;
     Category = category;
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SPEventLogServiceLog"/> class.
 /// </summary>
 /// <param name="log">The log.</param>
 /// <param name="eventID">The event ID.</param>
 /// <param name="areaName">Name of the area.</param>
 /// <param name="category">The category.</param>
 public SPEventLogServiceLog(IEventLogLogger log, int eventID, string areaName, string category)
 {
     if (log == null)
         throw new ArgumentNullException("log");
     if (string.IsNullOrEmpty(areaName))
         throw new ArgumentNullException("areaName");
     if (string.IsNullOrEmpty(category))
         throw new ArgumentNullException("category");
     Log = log;
     EventID = eventID;
     AreaName = areaName;
     Category = category;
 }