spectre.console/src/Spectre.Console.Testing/Fakes/FakeCommandInterceptor.cs
Patrik Svensson 0ae419326d Add Spectre.Cli to Spectre.Console
* Renames Spectre.Cli to Spectre.Console.Cli.
* Now uses Verify with Spectre.Console.Cli tests.
* Removes some duplicate definitions.

Closes #168
2020-12-28 17:28:03 +01:00

21 lines
564 B
C#

using System;
using Spectre.Console.Cli;
namespace Spectre.Console.Testing
{
public sealed class FakeCommandInterceptor : ICommandInterceptor
{
private readonly Action<CommandContext, CommandSettings> _action;
public FakeCommandInterceptor(Action<CommandContext, CommandSettings> action)
{
_action = action ?? throw new ArgumentNullException(nameof(action));
}
public void Intercept(CommandContext context, CommandSettings settings)
{
_action(context, settings);
}
}
}