public void NoReporters_UsesDefaultReporter() { var xunit = new Testable_xunit(); var reporter = xunit.GetReporter(); Assert.IsType <DefaultRunnerReporter>(reporter); }
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 <DefaultRunnerReporter>(reporter); }
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); }
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); }
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 <DefaultRunnerReporter>(reporter); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
public void NoReporters_UsesDefaultReporter() { var xunit = new Testable_xunit(); var reporter = xunit.GetReporter(); Assert.IsType<DefaultRunnerReporterWithTypes>(reporter); }