/// <summary>
 /// Determines whether a log message meets a specific condition or set
 /// of conditions.
 /// </summary>
 /// <param name="decorator">The unit test decorator of interest.</param>
 /// <returns>Returns true if the condition is met.</returns>
 public static Func <LogMessage, bool> IsUnitTestStartMessage(UnitTestLogDecorator decorator)
 {
     return(delegate(LogMessage message)
     {
         if (!IsUnitTestMessage(message))
         {
             return false;
         }
         if (false == message.HasDecorator(decorator))
         {
             return false;
         }
         if (message.HasDecorator(LogDecorator.TestStage))
         {
             TestStage ts = (TestStage)message[LogDecorator.TestStage];
             return ts == TestStage.Starting;
         }
         else
         {
             return false;
         }
     });
 }
Example #2
0
 /// <summary>
 /// Determines whether a log message meets a specific condition or set 
 /// of conditions.
 /// </summary>
 /// <param name="decorator">The unit test decorator of interest.</param>
 /// <returns>Returns true if the condition is met.</returns>
 public static Func<LogMessage, bool> IsUnitTestStartMessage(UnitTestLogDecorator decorator)
 {
     return delegate(LogMessage message)
     {
         if (!IsUnitTestMessage(message))
         {
             return false;
         }
         if (false == message.HasDecorator(decorator))
         {
             return false;
         }
         if (message.HasDecorator(LogDecorator.TestStage))
         {
             TestStage ts = (TestStage)message[LogDecorator.TestStage];
             return ts == TestStage.Starting;
         }
         else
         {
             return false;
         }
     };
 }