当前位置: 首页>>代码示例>>C#>>正文


C# Harness.LogMessage类代码示例

本文整理汇总了C#中Microsoft.Silverlight.Testing.Harness.LogMessage的典型用法代码示例。如果您正苦于以下问题:C# LogMessage类的具体用法?C# LogMessage怎么用?C# LogMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LogMessage类属于Microsoft.Silverlight.Testing.Harness命名空间,在下文中一共展示了LogMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CanTranslate

 public bool CanTranslate(LogMessage message)
 {
     if (message.MessageType == LogMessageType.TestResult)
     {
         if (message.Is(TestGranularity.TestScenario)
             && message.DecoratorMatches(LogDecorator.TestOutcome, v =>
                                                                       {
                                                                           switch ((TestOutcome)v)
                                                                           {
                                                                               case TestOutcome.Failed:
                                                                               case TestOutcome.Timeout:
                                                                               case TestOutcome.Inconclusive:
                                                                                   //TODO: reproduce case TestOutcome.Error:
                                                                                   return true;
                                                                               default:
                                                                                   return false;
                                                                           }
                                                                       })
             && message.DecoratorMatches(UnitTestLogDecorator.ScenarioResult, v => ((ScenarioResult)v).Exception != null)
             )
         {
             return true;
         }
     }
     return false;
 }
开发者ID:andywhitfield,项目名称:StatLight,代码行数:26,代码来源:TestExecutionMethodFailedClientEventMap.cs

示例2: ProcessRemainder

        protected override void ProcessRemainder(LogMessage message)
        {
            //DEBUG
            //var msg = TraceLogMessage(message);
            //Console.WriteLine(msg.Message);

            try
            {
                ClientEvent clientEvent;
                if (TryTranslateIntoClientEvent(message, out clientEvent))
                {
                    if (clientEvent != null)
                        Server.PostMessage(clientEvent);
                }
                else
                {
                    var traceClientEvent = TraceLogMessage(message);
                    Server.PostMessage(traceClientEvent);
                }
            }
            catch (Exception ex)
            {
                var messageObject = new UnhandledExceptionClientEvent
                                        {
                                            Exception = ex,
                                        };
                Server.PostMessage(messageObject);
            }
        }
开发者ID:InishTech,项目名称:StatLight,代码行数:29,代码来源:ServerHandlingLogProvider.cs

示例3: Process

        /// <summary>
        /// Display a LogMessage in the debug output window.
        /// </summary>
        /// <param name="logMessage">Message object.</param>
        public override void Process(LogMessage logMessage)
        {
            if (logMessage == null)
            {
                throw new ArgumentNullException("logMessage");
            }

            if ((logMessage.MessageType != LogMessageType.Debug) && !ShowEverything)
            {
                if (!ShowAllFailures)
                {
                    return;
                }
                
                if (logMessage.HasDecorator(LogDecorator.TestOutcome))
                {
                    TestOutcome outcome = (TestOutcome)logMessage[LogDecorator.TestOutcome];
                    if (outcome == TestOutcome.Passed)
                    {
                        return;
                    }
                }
            }

            // Skip Finishing messages, they're always duplicates
            if (logMessage.HasDecorator(LogDecorator.TestStage))
            {
                if ((TestStage)logMessage[LogDecorator.TestStage] == TestStage.Finishing)
                {
                    return;
                }
            }

            Debug.WriteLine(logMessage.ToString());
        }
开发者ID:modulexcite,项目名称:SilverlightToolkit,代码行数:39,代码来源:DebugOutputProvider.cs

示例4: Process

 public override void Process(LogMessage logMessage) {
     if(isFirstMessage) {
         isFirstMessage = false;
         ProcessStartMessage();
     } else
         if(logMessage.HasDecorator(LogDecorator.TestOutcome))
             ProcessResultMessage(logMessage);
 }
开发者ID:JustGitHubUser,项目名称:DevExpress.Mvvm.Free,代码行数:8,代码来源:Loggers.cs

示例5: HasUnitTestOutcome

 /// <summary>
 /// Determines whether a log message meets a specific condition or set 
 /// of conditions.
 /// </summary>
 /// <param name="message">The log message object.</param>
 /// <returns>Returns true if the condition is met.</returns>
 public static bool HasUnitTestOutcome(LogMessage message)
 {
     if (!IsUnitTestMessage(message))
     {
         return false;
     }
     return message.HasDecorator(LogDecorator.TestOutcome);
 }
开发者ID:garyjohnson,项目名称:wpnest,代码行数:14,代码来源:UnitTestMessageConditional.cs

示例6: IsExceptionLogMessage

 /// <summary>
 /// Determines whether a log message meets a specific condition or set 
 /// of conditions.
 /// </summary>
 /// <param name="message">The log message object.</param>
 /// <returns>Returns true if the condition is met.</returns>
 public static bool IsExceptionLogMessage(LogMessage message)
 {
     if (!IsUnitTestMessage(message))
     {
         return false;
     }
     return message.HasDecorator(UnitTestLogDecorator.ActualException);
 }
开发者ID:garyjohnson,项目名称:wpnest,代码行数:14,代码来源:UnitTestMessageConditional.cs

示例7: IsIncorrectExceptionLogMessage

 /// <summary>
 /// Determines whether a log message meets a specific condition or set 
 /// of conditions.
 /// </summary>
 /// <param name="message">The log message object.</param>
 /// <returns>Returns true if the condition is met.</returns>
 public static bool IsIncorrectExceptionLogMessage(LogMessage message)
 {
     if (!IsUnitTestMessage(message))
     {
         return false;
     }
     return message.HasDecorator(UnitTestLogDecorator.IncorrectExceptionMessage);
 }
开发者ID:garyjohnson,项目名称:wpnest,代码行数:14,代码来源:UnitTestMessageConditional.cs

示例8: Translate

 public ClientEvent Translate(LogMessage message)
 {
     var testMethod = (ITestMethod)message.Decorators[UnitTestLogDecorator.TestMethodMetadata];
     var clientEventX = new TestExecutionMethodBeginClientEvent
                            {
                                Started = DateTime.Now,
                            };
     clientEventX.AssignTestExecutionMethodInfo(testMethod);
     return clientEventX;
 }
开发者ID:brumfb,项目名称:StatLight,代码行数:10,代码来源:TestExecutionMethodBeginClientEventMap.cs

示例9: Translate

 public ClientEvent Translate(LogMessage message)
 {
     var testClass = (ITestClass)message.Decorators[UnitTestLogDecorator.TestClassMetadata];
     var clientEventX = new TestExecutionClassBeginClientEvent
                            {
                                ClassName = testClass.Type.ClassNameIncludingParentsIfNested(),
                                NamespaceName = testClass.Type.Namespace,
                            };
     return clientEventX;
 }
开发者ID:staxmanade,项目名称:StatLight,代码行数:10,代码来源:TestExecutionClassBeginClientEventMap.cs

示例10: CanTranslate

 public bool CanTranslate(LogMessage message)
 {
     if (message.MessageType == LogMessageType.TestInfrastructure)
     {
         if (message.Message.Equals("Initialization of UnitTestHarness", StringComparison.InvariantCultureIgnoreCase))
         {
             return true;
         }
     }
     return false;
 }
开发者ID:nnieslan,项目名称:StatLight,代码行数:11,代码来源:InitializationOfUnitTestHarnessClientEventMap.cs

示例11: ProcessResult

 /// <summary>
 /// Process a UTF result message.
 /// </summary>
 /// <param name="logMessage">The log message object.</param>
 private void ProcessResult(LogMessage logMessage)
 {
     if (logMessage.HasDecorator(UnitTestLogDecorator.TestMethodMetadata))
     {
         ScenarioResult sr = (ScenarioResult)logMessage[UnitTestLogDecorator.ScenarioResult];
         if (sr.Result != TestOutcome.Passed)
         {
             _failures.Add(sr);
         }
     }
 }
开发者ID:garyjohnson,项目名称:wpnest,代码行数:15,代码来源:TextFailuresLogProvider.cs

示例12: CanTranslate

 public bool CanTranslate(LogMessage message)
 {
     if (message.MessageType == LogMessageType.TestExecution)
     {
         if (message.Is(TestGranularity.TestScenario)
             && message.DecoratorMatches(UnitTestLogDecorator.IgnoreMessage, v => (bool)v)
             )
         {
             return true;
         }
     }
     return false;
 }
开发者ID:staxmanade,项目名称:StatLight,代码行数:13,代码来源:TestExecutionMethodIgnoredClientEventMap.cs

示例13: CanTranslate

 public bool CanTranslate(LogMessage message)
 {
     if (message.MessageType == LogMessageType.TestResult)
     {
         if (message.Is(TestGranularity.TestScenario)
             && message.DecoratorMatches(LogDecorator.TestOutcome, v => (TestOutcome)v == TestOutcome.Passed)
             )
         {
             return true;
         }
     }
     return false;
 }
开发者ID:andywhitfield,项目名称:StatLight,代码行数:13,代码来源:TestExecutionMethodPassedClientEventMap.cs

示例14: Translate

        public ClientEvent Translate(LogMessage message)
        {
            var scenarioResult = (ScenarioResult)message.Decorators[UnitTestLogDecorator.ScenarioResult];
            var testMethod = (ITestMethod)message.Decorators[UnitTestLogDecorator.TestMethodMetadata];

            var clientEventX = new TestExecutionMethodPassedClientEvent
                                   {
                                       Finished = scenarioResult.Finished,
                                       Started = scenarioResult.Started,
                                   };
            clientEventX.AssignTestExecutionMethodInfo(testMethod);
            return clientEventX;
        }
开发者ID:andywhitfield,项目名称:StatLight,代码行数:13,代码来源:TestExecutionMethodPassedClientEventMap.cs

示例15: CanTranslate

 public bool CanTranslate(LogMessage message)
 {
     if (message.MessageType == LogMessageType.TestExecution)
     {
         if (message.Is(TestStage.Starting)
             && message.Is(TestGranularity.TestScenario)
             && message.DecoratorMatches(UnitTestLogDecorator.TestMethodMetadata, v => v is ITestMethod)
             )
         {
             return true;
         }
     }
     return false;
 }
开发者ID:brumfb,项目名称:StatLight,代码行数:14,代码来源:TestExecutionMethodBeginClientEventMap.cs


注:本文中的Microsoft.Silverlight.Testing.Harness.LogMessage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。