fix(headless): route wire-only chat commands
This commit is contained in:
parent
41b15efd4d
commit
259f0e5ac3
3 changed files with 219 additions and 0 deletions
|
|
@ -54,6 +54,53 @@ public sealed class LiveSessionCommandRouterTests
|
|||
calls);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GraphicalRouteKeepsWireOnlyClientCommandParityWithHeadless()
|
||||
{
|
||||
var calls = new List<string>();
|
||||
ClientCommandController.Bindings client = NewClientBindings() with
|
||||
{
|
||||
AddPlayerPermission = name =>
|
||||
calls.Add($"permit:add:{name}"),
|
||||
RemovePlayerPermission = name =>
|
||||
calls.Add($"permit:remove:{name}"),
|
||||
ModifyGlobalSquelch = (add, messageType) =>
|
||||
calls.Add($"squelch:{add}:{messageType}"),
|
||||
};
|
||||
var router = NewRouter(clientBindings: client);
|
||||
router.Activate();
|
||||
|
||||
router.Publish(new ExecuteClientCommandCmd(
|
||||
ClientCommandId.Permit,
|
||||
"add Aunt Agatha"));
|
||||
router.Publish(new ExecuteClientCommandCmd(
|
||||
ClientCommandId.Permit,
|
||||
"remove Lord Gnarly Beard"));
|
||||
router.Publish(new ExecuteClientCommandCmd(
|
||||
ClientCommandId.ChatToggle,
|
||||
"on"));
|
||||
router.Publish(new ExecuteClientCommandCmd(
|
||||
ClientCommandId.ChatToggle,
|
||||
"off"));
|
||||
router.Publish(new ExecuteClientCommandCmd(
|
||||
ClientCommandId.NoTellToggle,
|
||||
"on"));
|
||||
router.Publish(new ExecuteClientCommandCmd(
|
||||
ClientCommandId.NoTellToggle,
|
||||
"off"));
|
||||
|
||||
Assert.Equal(
|
||||
[
|
||||
"permit:add:Aunt Agatha",
|
||||
"permit:remove:Lord Gnarly Beard",
|
||||
"squelch:False:2",
|
||||
"squelch:True:2",
|
||||
"squelch:True:3",
|
||||
"squelch:False:3",
|
||||
],
|
||||
calls);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InactiveAndDisposedRouter_CannotReachTransport()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue