From 57b18ec4192cab0401ef9a16e59af5af5dc286af Mon Sep 17 00:00:00 2001 From: Gurpreet Singh Date: Fri, 29 May 2026 17:13:31 +0100 Subject: [PATCH 1/2] print samples report to console --- .../TestStack.BDDfy.Samples/Startup.cs | 2 ++ .../TestStack.BDDfy.Samples.csproj | 5 +++- .../XUnitOutputReporter.cs | 28 +++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/TestStack.BDDfy.Tests/XUnitOutputReporter.cs diff --git a/src/Samples/TestStack.BDDfy.Samples/Startup.cs b/src/Samples/TestStack.BDDfy.Samples/Startup.cs index b1868502..c70060ea 100644 --- a/src/Samples/TestStack.BDDfy.Samples/Startup.cs +++ b/src/Samples/TestStack.BDDfy.Samples/Startup.cs @@ -2,6 +2,7 @@ using TestStack.BDDfy.Configuration; using TestStack.BDDfy.Reporters.Html; using TestStack.BDDfy.Samples.Atm; +using TestStack.BDDfy.Tests; namespace TestStack.BDDfy.Samples { @@ -11,6 +12,7 @@ public class Startup public static void Initialize() { Configurator.Processors.Add(() => new CustomTextReporter()); + Configurator.Processors.Add(() => new XUnitOutputReporter()); Configurator.Processors.ConsoleReport.Enable(); Configurator.BatchProcessors.MarkDownReport.Enable(); Configurator.BatchProcessors.DiagnosticsReport.Enable(); diff --git a/src/Samples/TestStack.BDDfy.Samples/TestStack.BDDfy.Samples.csproj b/src/Samples/TestStack.BDDfy.Samples/TestStack.BDDfy.Samples.csproj index c837c3c4..7b406da8 100644 --- a/src/Samples/TestStack.BDDfy.Samples/TestStack.BDDfy.Samples.csproj +++ b/src/Samples/TestStack.BDDfy.Samples/TestStack.BDDfy.Samples.csproj @@ -6,7 +6,6 @@ true true - @@ -24,4 +23,8 @@ + + + + diff --git a/src/TestStack.BDDfy.Tests/XUnitOutputReporter.cs b/src/TestStack.BDDfy.Tests/XUnitOutputReporter.cs new file mode 100644 index 00000000..4e02a043 --- /dev/null +++ b/src/TestStack.BDDfy.Tests/XUnitOutputReporter.cs @@ -0,0 +1,28 @@ +using TestStack.BDDfy.Reporters; +using Xunit; + +namespace TestStack.BDDfy.Tests +{ + public class XUnitOutputReporter(ITestOutputHelper testOutputHelper = null): TextReporter + { + private ITestOutputHelper _outputHelper = testOutputHelper ?? Xunit.TestContext.Current.TestOutputHelper; + + protected override void WriteLine(string text = null) + { + if (text is not null) _outputHelper.WriteLine(text); + base.WriteLine(text); + } + + protected override void Write(string text, params object[] args) + { + _outputHelper.Write(text, args); + base.Write(text, args); + } + + protected override void WriteLine(string text, params object[] args) + { + _outputHelper.WriteLine(text, args); + base.WriteLine(text, args); + } + } +} \ No newline at end of file From 84c2b673cceb6cffe96bd2a16181174923501e18 Mon Sep 17 00:00:00 2001 From: Gurpreet Singh Date: Fri, 29 May 2026 17:20:39 +0100 Subject: [PATCH 2/2] include missing file reference --- .../TestStack.BDDfy.Samples/TestStack.BDDfy.Samples.csproj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Samples/TestStack.BDDfy.Samples/TestStack.BDDfy.Samples.csproj b/src/Samples/TestStack.BDDfy.Samples/TestStack.BDDfy.Samples.csproj index 7b406da8..803424c9 100644 --- a/src/Samples/TestStack.BDDfy.Samples/TestStack.BDDfy.Samples.csproj +++ b/src/Samples/TestStack.BDDfy.Samples/TestStack.BDDfy.Samples.csproj @@ -7,9 +7,8 @@ true - + - all