本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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
//.........这里部分代码省略.........