using GFramework.Core.Command;
namespace GFramework.Core.Tests.Command;
///
/// 表示 使用的带返回值同步测试命令。
///
public sealed class TestCommandWithResult : AbstractCommand
{
///
/// 初始化 的新实例。
///
/// 命令输入。
public TestCommandWithResult(TestCommandInput input) : base(input)
{
}
///
/// 获取一个值,该值指示命令是否已经执行。
///
public bool Executed { get; private set; }
///
/// 执行测试命令并返回基于输入值计算的结果。
///
/// 命令输入。
/// 输入值的两倍。
protected override int OnExecute(TestCommandInput input)
{
Executed = true;
return input.Value * 2;
}
}