1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

update unit tests

This commit is contained in:
RaidMax
2020-11-12 19:46:17 -06:00
parent 3e1db4b00a
commit f5c2f92652
10 changed files with 52 additions and 58 deletions

View File

@ -41,6 +41,8 @@ namespace ApplicationTests
fakeRConParser = serviceProvider.GetRequiredService<IRConParser>();
mockEventHandler = serviceProvider.GetRequiredService<EventHandlerMock>();
appConfig = serviceProvider.GetRequiredService<ApplicationConfiguration>();
serviceProvider.GetService<IW4MServer>().RconParser =
serviceProvider.GetService<IRConParser>();
var rconConnectionFactory = serviceProvider.GetRequiredService<IRConConnectionFactory>();
@ -215,7 +217,7 @@ namespace ApplicationTests
await server.Ban("test reason", target, origin);
A.CallTo(() => fakeRConParser.ExecuteCommandAsync(fakeRConConnection, "kick"))
A.CallTo(() => server.RconParser.ExecuteCommandAsync(A<IRConConnection>.Ignored, "kick"))
.MustHaveHappenedOnceExactly();
}
@ -290,7 +292,7 @@ namespace ApplicationTests
await server.TempBan("test reason", TimeSpan.Zero, target, origin);
A.CallTo(() => fakeRConParser.ExecuteCommandAsync(fakeRConConnection, "kick"))
A.CallTo(() => server.RconParser.ExecuteCommandAsync(A<IRConConnection>.Ignored, "kick"))
.MustHaveHappenedOnceExactly();
}
@ -312,7 +314,7 @@ namespace ApplicationTests
await server.TempBan("test reason", TimeSpan.Zero, target, origin);
A.CallTo(() => fakeRConParser.ExecuteCommandAsync(fakeRConConnection, "kick"))
A.CallTo(() => server.RconParser.ExecuteCommandAsync(A<IRConConnection>.Ignored, "kick"))
.MustHaveHappenedOnceExactly();
}
#endregion
@ -348,7 +350,7 @@ namespace ApplicationTests
await server.Kick("test reason", target, origin);
A.CallTo(() => fakeRConParser.ExecuteCommandAsync(fakeRConConnection, "kick"))
A.CallTo(() => server.RconParser.ExecuteCommandAsync(A<IRConConnection>.Ignored, "kick"))
.MustHaveHappenedOnceExactly();
}