mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 08:52:50 +08:00

* Renames Spectre.Cli to Spectre.Console.Cli. * Now uses Verify with Spectre.Console.Cli tests. * Removes some duplicate definitions. Closes #168
21 lines
564 B
C#
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);
|
|
}
|
|
}
|
|
}
|