Skip to content

Commit

Permalink
Move TestOutputProvider to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
geofflamrock committed Dec 19, 2024
1 parent eb98f90 commit 780da87
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 43 deletions.
43 changes: 0 additions & 43 deletions src/Stack.Tests/Commands/Stack/UpdateStackCommandHandlerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,6 @@

namespace Stack.Tests.Commands.Stack;

public class TestOutputProvider(ITestOutputHelper testOutputHelper) : IOutputProvider
{
public void Debug(string message)
{
testOutputHelper.WriteLine($"DEBUG: {message}");
}

public void Error(string message)
{
testOutputHelper.WriteLine($"ERROR: {message}");
}

public void Information(string message)
{
testOutputHelper.WriteLine($"INFO: {message}");
}

public void Rule(string message)
{
testOutputHelper.WriteLine($"RULE: {message}");
}

public void Status(string message, Action action)
{
testOutputHelper.WriteLine($"STATUS: {message}");
action();
}

public void Tree(string header, string[] items)
{
testOutputHelper.WriteLine($"TREE: {header}");
foreach (var item in items)
{
testOutputHelper.WriteLine($" {item}");
}
}

public void Warning(string message)
{
testOutputHelper.WriteLine($"WARNING: {message}");
}
}

public class UpdateStackCommandHandlerTests(ITestOutputHelper testOutputHelper)
{
[Fact]
Expand Down
47 changes: 47 additions & 0 deletions src/Stack.Tests/Helpers/TestOutputProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using Stack.Infrastructure;
using Xunit.Abstractions;

namespace Stack.Tests.Helpers;

public class TestOutputProvider(ITestOutputHelper testOutputHelper) : IOutputProvider
{
public void Debug(string message)
{
testOutputHelper.WriteLine($"DEBUG: {message}");
}

public void Error(string message)
{
testOutputHelper.WriteLine($"ERROR: {message}");
}

public void Information(string message)
{
testOutputHelper.WriteLine($"INFO: {message}");
}

public void Rule(string message)
{
testOutputHelper.WriteLine($"RULE: {message}");
}

public void Status(string message, Action action)
{
testOutputHelper.WriteLine($"STATUS: {message}");
action();
}

public void Tree(string header, string[] items)
{
testOutputHelper.WriteLine($"TREE: {header}");
foreach (var item in items)
{
testOutputHelper.WriteLine($" {item}");
}
}

public void Warning(string message)
{
testOutputHelper.WriteLine($"WARNING: {message}");
}
}

0 comments on commit 780da87

Please sign in to comment.