當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。