本文整理汇总了C#中Testable_xunit.GetReporter方法的典型用法代码示例。如果您正苦于以下问题:C# Testable_xunit.GetReporter方法的具体用法?C# Testable_xunit.GetReporter怎么用?C# Testable_xunit.GetReporter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Testable_xunit
的用法示例。
在下文中一共展示了Testable_xunit.GetReporter方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BadChosenReporter_WithAvailableReporters
public void BadChosenReporter_WithAvailableReporters()
{
var xunit = new Testable_xunit { Reporter = "foo" };
xunit.AvailableReporters.AddRange(new[] { Mocks.RunnerReporter("switch1"), Mocks.RunnerReporter("switch2") });
var reporter = xunit.GetReporter();
Assert.Null(reporter);
var eventArgs = Assert.IsType<BuildErrorEventArgs>(xunit.BuildEngine.Captured(x => x.LogErrorEvent(null)).Args().Single());
Assert.Equal("Reporter value 'foo' is invalid. Available reporters: switch1, switch2", eventArgs.Message);
}
示例2: NoExplicitReporter_SelectsFirstEnvironmentallyEnabledReporter
public void NoExplicitReporter_SelectsFirstEnvironmentallyEnabledReporter()
{
var explicitReporter = Mocks.RunnerReporter("switch");
var implicitReporter1 = Mocks.RunnerReporter(isEnvironmentallyEnabled: true);
var implicitReporter2 = Mocks.RunnerReporter(isEnvironmentallyEnabled: true);
var xunit = new Testable_xunit();
xunit.AvailableReporters.AddRange(new[] { explicitReporter, implicitReporter1, implicitReporter2 });
var reporter = xunit.GetReporter();
Assert.Same(implicitReporter1, reporter);
}
示例3: BadChosenReporter_NoAvailableReporters
public void BadChosenReporter_NoAvailableReporters()
{
var xunit = new Testable_xunit { Reporter = "foo" };
var reporter = xunit.GetReporter();
Assert.Null(reporter);
var eventArgs = Assert.IsType<BuildErrorEventArgs>(xunit.BuildEngine.Captured(x => x.LogErrorEvent(null)).Args().Single());
Assert.Equal("Reporter value 'foo' is invalid. There are no available reporters.", eventArgs.Message);
}
示例4: WithEnvironmentalOverride_WithEnvironmentalOverridesDisabled_UsesDefaultReporter
public void WithEnvironmentalOverride_WithEnvironmentalOverridesDisabled_UsesDefaultReporter()
{
var implicitReporter = Mocks.RunnerReporter(isEnvironmentallyEnabled: true);
var xunit = new Testable_xunit { NoAutoReporters = true };
xunit.AvailableReporters.Add(implicitReporter);
var reporter = xunit.GetReporter();
Assert.IsType<DefaultRunnerReporterWithTypes>(reporter);
}
示例5: ExplicitReporter_WithEnvironmentalOverride_UsesEnvironmentalOverride
public void ExplicitReporter_WithEnvironmentalOverride_UsesEnvironmentalOverride()
{
var explicitReporter = Mocks.RunnerReporter("switch");
var implicitReporter = Mocks.RunnerReporter(isEnvironmentallyEnabled: true);
var xunit = new Testable_xunit { Reporter = "switch" };
xunit.AvailableReporters.AddRange(new[] { explicitReporter, implicitReporter });
var reporter = xunit.GetReporter();
Assert.Same(implicitReporter, reporter);
}
示例6: ExplicitReporter_NoEnvironmentalOverride_UsesExplicitReporter
public void ExplicitReporter_NoEnvironmentalOverride_UsesExplicitReporter()
{
var explicitReporter = Mocks.RunnerReporter("switch");
var xunit = new Testable_xunit { Reporter = "switch" };
xunit.AvailableReporters.Add(explicitReporter);
var reporter = xunit.GetReporter();
Assert.Same(explicitReporter, reporter);
}
示例7: NoExplicitReporter_NoEnvironmentallyEnabledReporters_UsesDefaultReporter
public void NoExplicitReporter_NoEnvironmentallyEnabledReporters_UsesDefaultReporter()
{
var implicitReporter = Mocks.RunnerReporter(isEnvironmentallyEnabled: false);
var xunit = new Testable_xunit();
xunit.AvailableReporters.Add(implicitReporter);
var reporter = xunit.GetReporter();
Assert.IsType<DefaultRunnerReporterWithTypes>(reporter);
}
示例8: NoReporters_UsesDefaultReporter
public void NoReporters_UsesDefaultReporter()
{
var xunit = new Testable_xunit();
var reporter = xunit.GetReporter();
Assert.IsType<DefaultRunnerReporterWithTypes>(reporter);
}