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

bugfixes/enhancements

prevent users from trying to set the console's level to owner
fix issue with setting multiple owners
update/improve unit tests
This commit is contained in:
RaidMax
2020-05-16 11:54:01 -05:00
parent 51dd3837c8
commit 136b9e3d3d
12 changed files with 500 additions and 82 deletions

View File

@ -22,14 +22,17 @@ namespace ApplicationTests
{
ILogger logger;
private IServiceProvider serviceProvider;
private IConfigurationHandlerFactory handlerFactory;
[SetUp]
public void Setup()
{
logger = A.Fake<ILogger>();
handlerFactory = A.Fake<IConfigurationHandlerFactory>();
serviceProvider = new ServiceCollection()
.BuildBase()
.AddSingleton<IW4MAdmin.Plugins.Stats.Plugin>()
.BuildServiceProvider();
void testLog(string msg) => Console.WriteLine(msg);
@ -44,9 +47,8 @@ namespace ApplicationTests
public void TestKDR()
{
var mgr = A.Fake<IManager>();
var handlerFactory = A.Fake<IConfigurationHandlerFactory>();
var config = A.Fake<IConfigurationHandler<StatsConfiguration>>();
var plugin = new IW4MAdmin.Plugins.Stats.Plugin(handlerFactory, null);
var plugin = serviceProvider.GetRequiredService<IW4MAdmin.Plugins.Stats.Plugin>();
A.CallTo(() => config.Configuration())
.Returns(new StatsConfiguration()