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


C# LogMessage.DecoratorMatches方法代码示例

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


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

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

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

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

示例6: 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:
                                                                                   return true;
                                                                               default:
                                                                                   return false;
                                                                           }
                                                                       })
             )
         {
             return true;
         }
     }
     return false;
 }
开发者ID:nnieslan,项目名称:StatLight,代码行数:22,代码来源:TestExecutionMethodExpectedExcaptionFailedClientEventMap.cs

示例7: CanTranslate

        public bool CanTranslate(LogMessage message)
        {
            if (message.MessageType == LogMessageType.TestExecution)
            {
                if (message.Is(TestStage.Finishing)
                    && message.Is(TestGranularity.TestScenario)
                    && message.DecoratorMatches(UnitTestLogDecorator.TestMethodMetadata, v => v is ITestMethod)
                    )
                {
                    return true;
                }

                /*
            MessageType=TestExecution
            Message=Unit Testing
            Decorators:
            KeyType(typeof,string)=Microsoft.Silverlight.Testing.UnitTesting.Harness.UnitTestLogDecorator, IsUnitTestMessage, ValueType=System.Boolean, True
            KeyType(typeof,string)=Microsoft.Silverlight.Testing.Harness.LogDecorator, NameProperty, ValueType=System.String, Unit Testing
            KeyType(typeof,string)=Microsoft.Silverlight.Testing.Harness.LogDecorator, TestGranularity, ValueType=Microsoft.Silverlight.Testing.Harness.TestGranularity, Harness
            KeyType(typeof,string)=Microsoft.Silverlight.Testing.UnitTesting.Harness.UnitTestLogDecorator, UnitTestHarness, ValueType=Microsoft.Silverlight.Testing.UnitTesting.Harness.UnitTestHarness, Microsoft.Silverlight.Testing.UnitTesting.Harness.UnitTestHarness
            KeyType(typeof,string)=Microsoft.Silverlight.Testing.Harness.LogDecorator, TestStage, ValueType=Microsoft.Silverlight.Testing.Harness.TestStage, Starting
                */
                if (message.Is(TestStage.Starting)
                    && message.Is(TestGranularity.Harness)
                    )
                {
                    return true;
                }

                if (message.Is(TestStage.Starting)
                    && message.Is(TestGranularity.TestGroup)
                    )
                {
                    return true;
                }
            }

            /*
            MessageType=Error
            Message=Exception: Type "Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException" Message "Assert.IsTrue failed. "
            Decorators:
            KeyType(typeof,string)=Microsoft.Silverlight.Testing.UnitTesting.Harness.UnitTestLogDecorator, IsUnitTestMessage, ValueType=System.Boolean, True
            KeyType(typeof,string)=Microsoft.Silverlight.Testing.Harness.LogDecorator, TestGranularity, ValueType=Microsoft.Silverlight.Testing.Harness.TestGranularity, TestScenario
            KeyType(typeof,string)=Microsoft.Silverlight.Testing.UnitTesting.Harness.UnitTestLogDecorator, ActualException, ValueType=Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException, Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Assert.IsTrue failed.
               at Microsoft.VisualStudio.TestTools.UnitTesting.Assert.HandleFail(String assertionName, String message, Object[] parameters)
               at Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsTrue(Boolean condition, String message, Object[] parameters)
               at Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsTrue(Boolean condition)
               at StatLight.IntegrationTests.Silverlight.MSTestTests.this_should_be_a_Failing_test()
            KeyType(typeof,string)=Microsoft.Silverlight.Testing.UnitTesting.Harness.UnitTestLogDecorator, TestClassMetadata, ValueType=StatLight.Client.Harness.UnitTestProviders.MSTest.TestClass, StatLight.Client.Harness.UnitTestProviders.MSTest.TestClass
            KeyType(typeof,string)=Microsoft.Silverlight.Testing.UnitTesting.Harness.UnitTestLogDecorator, TestMethodMetadata, ValueType=StatLight.Client.Harness.UnitTestProviders.MSTest.TestMethod, StatLight.Client.Harness.UnitTestProviders.MSTest.TestMethod
             */

            if (message.MessageType == LogMessageType.Error)
            {
                if (message.DecoratorMatches(UnitTestLogDecorator.TestClassMetadata, v => v != null) &&
                    message.DecoratorMatches(UnitTestLogDecorator.TestMethodMetadata, v => v != null))
                {
                    return true;
                }
            }

            /*
            MessageType=TestInfrastructure
            Message=Unit Test Run
            Decorators:
            KeyType(typeof,string)=Microsoft.Silverlight.Testing.UnitTesting.Harness.UnitTestLogDecorator, IsUnitTestMessage, ValueType=System.Boolean, True
            KeyType(typeof,string)=Microsoft.Silverlight.Testing.UnitTesting.Harness.UnitTestLogDecorator, TestRunFilter, ValueType=Microsoft.Silverlight.Testing.UnitTesting.Harness.TestRunFilter, Microsoft.Silverlight.Testing.UnitTesting.Harness.TestRunFilter
             */
            if (message.MessageType == LogMessageType.TestInfrastructure)
            {
                if (message.DecoratorMatches(UnitTestLogDecorator.IsUnitTestMessage, v => (bool)v) &&
                    message.DecoratorMatches(UnitTestLogDecorator.TestRunFilter, v => v != null))
                {
                    return true;
                }
            }

            /*
            MessageType=TestExecution
            Message=TestGroupStatLight.IntegrationTests.Silverlight.MSTest finishing
            Decorators:
            KeyType(typeof,string)=Microsoft.Silverlight.Testing.UnitTesting.Harness.UnitTestLogDecorator, IsUnitTestMessage, ValueType=System.Boolean, True
            KeyType(typeof,string)=Microsoft.Silverlight.Testing.Harness.LogDecorator, NameProperty, ValueType=System.String, StatLight.IntegrationTests.Silverlight.MSTest
            KeyType(typeof,string)=Microsoft.Silverlight.Testing.Harness.LogDecorator, TestGranularity, ValueType=Microsoft.Silverlight.Testing.Harness.TestGranularity, TestGroup
            KeyType(typeof,string)=Microsoft.Silverlight.Testing.UnitTesting.Harness.UnitTestLogDecorator, TestAssemblyMetadata, ValueType=StatLight.Client.Harness.UnitTestProviders.MSTest.UnitTestFrameworkAssembly, StatLight.Client.Harness.UnitTestProviders.MSTest.UnitTestFrameworkAssembly
            KeyType(typeof,string)=Microsoft.Silverlight.Testing.Harness.LogDecorator, TestStage, ValueType=Microsoft.Silverlight.Testing.Harness.TestStage, Finishing
             */
            if (message.MessageType == LogMessageType.TestExecution)
            {
                if (message.DecoratorMatches(LogDecorator.TestGranularity, v => ((TestGranularity)v) == TestGranularity.TestGroup) &&
                    message.DecoratorMatches(LogDecorator.TestStage, v => ((TestStage)v) == TestStage.Finishing)
                    )
                {
                    return true;
                }
            }

            /*
            MessageType=TestExecution
            Message=Unit Testing
//.........这里部分代码省略.........
开发者ID:andywhitfield,项目名称:StatLight,代码行数:101,代码来源:TestExecutionDoNotReportMessageMap.cs


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