mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
fix issue with partial matches for map load command
This commit is contained in:
@ -606,6 +606,25 @@ namespace ApplicationTests
|
||||
A.CallTo(() => rconParser.ExecuteCommandAsync(A<IRConConnection>.Ignored, A<string>.Ignored))
|
||||
.MustHaveHappened();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task Test_LoadMap_FindsMapName_FromPartialAlias()
|
||||
{
|
||||
var cmd = serviceProvider.GetRequiredService<LoadMapCommand>();
|
||||
var server = serviceProvider.GetRequiredService<IW4MServer>();
|
||||
var rconParser = serviceProvider.GetRequiredService<IRConParser>();
|
||||
server.Maps.Add(new Map()
|
||||
{
|
||||
Name = "mp_test",
|
||||
Alias = "test"
|
||||
});
|
||||
var gameEvent = EventGenerators.GenerateEvent(GameEvent.EventType.Command, server.Maps.First().Name, server);
|
||||
|
||||
await cmd.ExecuteAsync(gameEvent);
|
||||
|
||||
A.CallTo(() => rconParser.ExecuteCommandAsync(A<IRConConnection>.Ignored, A<string>.That.Contains(server.Maps[0].Name)))
|
||||
.MustHaveHappened();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user