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


C# LogMessage.HasDecorator方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: Process

            public override void Process(LogMessage logMessage)
            {
                if (logMessage.HasDecorator(LogDecorator.TestStage))
                {
                    var stage = (TestStage)logMessage[LogDecorator.TestStage];
                    if (stage == TestStage.Starting)
                    {
                        if (logMessage.HasDecorator(UnitTestLogDecorator.TestMethodMetadata))
                        {
                            var methodInfo = (TestMethod)logMessage[UnitTestLogDecorator.TestMethodMetadata];
                            var wc = new WebClient();
                            wc.UploadStringAsync(new Uri(baseUrl, "/TestMethodStarting?method=" + methodInfo.Name), "");
                        }
                        else if (logMessage.HasDecorator(UnitTestLogDecorator.TestClassMetadata))
                        {
                            var classInfo = (TestClass)logMessage[UnitTestLogDecorator.TestClassMetadata];
                            var wc = new WebClient();
                            wc.UploadStringAsync(new Uri(baseUrl, "/TestClassStarting?class=" + classInfo.Type.FullName), "");
                        }
                    }
                }

                if (logMessage.HasDecorator(UnitTestLogDecorator.ScenarioResult))
                {
                    var result = (ScenarioResult)logMessage[UnitTestLogDecorator.ScenarioResult];
                    var wc = new WebClient();
                    StringBuilder uri = new StringBuilder();
                    uri.Append("/TestMethodCompleted?result=" + result.Result);
                    if (result.TestClass != null)
                    {
                        uri.Append("&class=").Append(result.TestClass.Type.FullName);
                    }
                    if (result.TestMethod != null)
                    {
                        uri.Append("&method=").Append(result.TestMethod.Name);
                    }
                    wc.UploadStringAsync(new Uri(baseUrl, uri.ToString()), "");
                }
            }
开发者ID:semirs,项目名称:CellAO,代码行数:39,代码来源:App.xaml.cs

示例8: 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

示例9: IsUnitTestEndMessage

 /// <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 IsUnitTestEndMessage(LogMessage message)
 {
     if (!IsUnitTestMessage(message))
     {
         return false;
     }
     if (message.HasDecorator(LogDecorator.TestStage))
     {
         TestStage ts = (TestStage)message[LogDecorator.TestStage];
         return ts == TestStage.Finishing;
     }
     else
     {
         return false;
     }
 }
开发者ID:dfr0,项目名称:moon,代码行数:22,代码来源:UnitTestMessageConditional.cs

示例10: 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))
            {
                TestOutcome result = (TestOutcome)logMessage[LogDecorator.TestOutcome];
                ITestMethod method = (ITestMethod)logMessage[UnitTestLogDecorator.TestMethodMetadata];
                ITestClass test = (ITestClass)logMessage[UnitTestLogDecorator.TestClassMetadata];
                ScenarioResult sr = (ScenarioResult)logMessage[UnitTestLogDecorator.ScenarioResult];

                string storage = CurrentAssemblyName;
                string codeBase = CurrentAssemblyName;
                string adapterTypeName = TestAdapterTypeName;
                string className = test.Name;
                string testListName = TestListName;
                string computerName = ComputerName;
                DateTime startTime = sr.Started;
                DateTime endTime = sr.Finished;
                _writer.AddTestMethodResult(method, storage, codeBase, adapterTypeName, className, testListName, computerName, startTime, endTime, result);
                _writer.IncrementResults(result);
            }
        }
开发者ID:modulexcite,项目名称:SilverlightToolkit,代码行数:25,代码来源:VisualStudioLogProvider.cs

示例11: IsTestRunFilterMessage

 /// <summary>
 /// Determines whether a log message has an attached TestRunFilter.
 /// </summary>
 /// <param name="message">The log message object.</param>
 /// <returns>Returns a value indicating whether the condition is met.</returns>
 public static bool IsTestRunFilterMessage(LogMessage message)
 {
     return message.HasDecorator(UnitTestLogDecorator.TestRunFilter);
 }
开发者ID:garyjohnson,项目名称:wpnest,代码行数:9,代码来源:UnitTestMessageConditional.cs

示例12: IsIgnoreMessage

 /// <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 IsIgnoreMessage(LogMessage message)
 {
     return message.HasDecorator(UnitTestLogDecorator.IgnoreMessage);
 }
开发者ID:garyjohnson,项目名称:wpnest,代码行数:10,代码来源:UnitTestMessageConditional.cs

示例13: IsUnitTestMessage

 /// <summary>
 /// Returns a value indicating whether the message is marked as a unit
 /// test system message.
 /// </summary>
 /// <param name="message">The message.</param>
 /// <returns>Returns true if the message is a unit test system-marked 
 /// message.</returns>
 private static bool IsUnitTestMessage(LogMessage message)
 {
     return message.HasDecorator(UnitTestLogDecorator.IsUnitTestMessage);
 }
开发者ID:garyjohnson,项目名称:wpnest,代码行数:11,代码来源:UnitTestMessageConditional.cs

示例14: NotFailedButWithResults

 /// <summary>
 /// Conditional check, if the message has results and the current state 
 /// of the run, as tracked by this provider, is "pass".
 /// </summary>
 /// <param name="message">The log message.</param>
 /// <returns>Returns true when the conditions are met.</returns>
 private bool NotFailedButWithResults(LogMessage message)
 {
     // A. Must be in a passing state
     // B. Must have results
     return (!_hasFailed && message.HasDecorator(LogDecorator.TestOutcome));
 }
开发者ID:dfr0,项目名称:moon,代码行数:12,代码来源:WebpageHeaderLogProvider.cs

示例15: IsGranularMessage

 /// <summary>
 /// Conditional check for the granularity decorator.
 /// </summary>
 /// <param name="message">The log message.</param>
 /// <returns>Returns true if the condition is met.</returns>
 private bool IsGranularMessage(LogMessage message)
 {
     return (message.HasDecorator(LogDecorator.TestGranularity));
 }
开发者ID:dfr0,项目名称:moon,代码行数:9,代码来源:WebpageLogProvider.cs


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