IW4M-Admin/Tests/ApplicationTests/Mocks/Commands.cs
RaidMax 58bfd189d0 [issue #126]
implement basic run-as functionality
2020-04-26 21:12:49 -05:00

37 lines
979 B
C#

using SharedLibraryCore;
using SharedLibraryCore.Configuration;
using SharedLibraryCore.Interfaces;
using System;
using System.Threading.Tasks;
namespace ApplicationTests.Mocks
{
class ImpersonatableCommand : Command
{
public ImpersonatableCommand(CommandConfiguration config, ITranslationLookup lookup) : base(config, lookup)
{
AllowImpersonation = true;
Name = nameof(ImpersonatableCommand);
}
public override Task ExecuteAsync(GameEvent E)
{
E.Origin.Tell("test");
return Task.CompletedTask;
}
}
class NonImpersonatableCommand : Command
{
public NonImpersonatableCommand(CommandConfiguration config, ITranslationLookup lookup) : base(config, lookup)
{
Name = nameof(NonImpersonatableCommand);
}
public override Task ExecuteAsync(GameEvent E)
{
return Task.CompletedTask;
}
}
}