mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
fix dependency injection of comands in webfront preventing ui actions from working
This commit is contained in:
@ -38,6 +38,7 @@ namespace ApplicationTests
|
||||
.AddSingleton<IManagerCommand, FlagClientCommand>()
|
||||
.AddSingleton<IManagerCommand, UnflagClientCommand>()
|
||||
.AddSingleton<IManagerCommand, SayCommand>()
|
||||
.AddSingleton<IManagerCommand, SetLevelCommand>()
|
||||
.BuildServiceProvider()
|
||||
.SetupTestHooks();
|
||||
|
||||
@ -141,6 +142,19 @@ namespace ApplicationTests
|
||||
Assert.AreEqual(expectedEndpoint, result.RouteValues["serverId"]);
|
||||
Assert.AreEqual(expectedCommandText, result.RouteValues["command"]);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task Test_SetLevel_Redirects_WithCommandText()
|
||||
{
|
||||
var controller = serviceProvider.GetRequiredService<ActionController>();
|
||||
var expectedCommandText = "!setlevel @1 Moderator";
|
||||
var expectedEndpoint = server.EndPoint;
|
||||
|
||||
var result = await controller.EditAsync(1, "Moderator") as RedirectToActionResult;
|
||||
|
||||
Assert.AreEqual(expectedEndpoint, result.RouteValues["serverId"]);
|
||||
Assert.AreEqual(expectedCommandText, result.RouteValues["command"]);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user