• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Harness.LogMessage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Translate

        public ClientEvent Translate(LogMessage message)
        {
            var testName = (string)message.Decorators[LogDecorator.NameProperty];
            var clientEventX = new TestExecutionMethodIgnoredClientEvent
                                   {
                                       ClassName = null,
                                       NamespaceName = null,
                                       MethodName = testName,
                                       Message = testName,
                                       Started = DateTime.Now,
                                   };

            return clientEventX;
        }
开发者ID:staxmanade,项目名称:StatLight,代码行数:14,代码来源:TestExecutionMethodIgnoredClientEventMap.cs


示例17: CanTranslate

 public bool CanTranslate(LogMessage message)
 {
     if (message.MessageType == LogMessageType.TestExecution)
     {
         if (message.Is(TestStage.Finishing)
             && message.Is(TestGranularity.Test)
             && message.DecoratorMatches(UnitTestLogDecorator.TestClassMetadata, v => v is ITestClass)
             )
         {
             return true;
         }
     }
     return false;
 }
开发者ID:nnieslan,项目名称:StatLight,代码行数:14,代码来源:TestExecutionClassCompletedClientEventMap.cs


示例18: TraceLogMessage

 public static TraceClientEvent TraceLogMessage(LogMessage message)
 {
     const string newLine = "\n";
     string msg = "";
     msg += "MessageType={0}".FormatWith(message.MessageType);
     msg += newLine;
     msg += "Message={0}".FormatWith(message.Message);
     msg += newLine;
     msg += "Decorators:";
     msg += newLine;
     msg += GetDecorators(message.Decorators);
     msg += newLine;
     return new TraceClientEvent { Message = msg };
 }
开发者ID:nnieslan,项目名称:StatLight,代码行数:14,代码来源:ServerHandlingLogProvider.cs


示例19: Process

            public override void Process(LogMessage logMessage)
            {
                if (logMessage.HasDecorator(UnitTestLogDecorator.ScenarioResult))
                {
                    var result = (ScenarioResult)logMessage[UnitTestLogDecorator.ScenarioResult];

                    InvokeDomMethod("scenarioResult",
                                           result.Started.Ticks,
                                           result.Finished.Ticks,
                                           (result.TestClass != null) ? result.TestClass.Type.FullName : null,
                                           (result.TestMethod != null) ? result.TestMethod.Name : null,
                                           result.Result.ToString(),
                                           (result.Exception != null) ? result.Exception.ToString() : null);
                }
            }
开发者ID:ChadBurggraf,项目名称:NLog,代码行数:15,代码来源:App.xaml.cs


示例20: Translate

        public ClientEvent Translate(LogMessage message)
        {
            var scenarioResult = (ScenarioResult)message.Decorators[UnitTestLogDecorator.ScenarioResult];
            var testMethod = (ITestMethod)message.Decorators[UnitTestLogDecorator.TestMethodMetadata];
            var clientEventX = new TestExecutionMethodFailedClientEvent
                                   {
                                       ExceptionInfo = new ExceptionInfo(new Exception("An expected exception was not thrown.")),
                                       Finished = scenarioResult.Finished,
                                       Started = scenarioResult.Started,
                                   };
            clientEventX.AssignMetadata(testMethod.Method);
            clientEventX.AssignTestExecutionMethodInfo(testMethod);

            return clientEventX;
        }
开发者ID:nnieslan,项目名称:StatLight,代码行数:15,代码来源:TestExecutionMethodExpectedExcaptionFailedClientEventMap.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Ipc.JvmObjectReference类代码示例发布时间:2022-05-26
下一篇:
C# Runtime.CodeContext类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap