mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-11 07:40:54 -05:00
actually fix the session score concurrency issue
fix rare bug with shared guid kicker plugin allow hiding of the connection lost notification
This commit is contained in:
37
Tests/ApplicationTests/DepedencyInjectionExtensions.cs
Normal file
37
Tests/ApplicationTests/DepedencyInjectionExtensions.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using ApplicationTests.Fixtures;
|
||||
using FakeItEasy;
|
||||
using IW4MAdmin;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SharedLibraryCore.Interfaces;
|
||||
using SharedLibraryCore.Services;
|
||||
|
||||
namespace ApplicationTests
|
||||
{
|
||||
static class DepedencyInjectionExtensions
|
||||
{
|
||||
public static IServiceCollection BuildBase(this IServiceCollection serviceCollection)
|
||||
{
|
||||
var manager = A.Fake<IManager>();
|
||||
var logger = A.Fake<ILogger>();
|
||||
A.CallTo(() => manager.GetLogger(A<long>.Ignored))
|
||||
.Returns(logger);
|
||||
|
||||
serviceCollection.AddSingleton(logger)
|
||||
.AddSingleton(manager)
|
||||
.AddSingleton(A.Fake<IRConConnectionFactory>())
|
||||
.AddSingleton(A.Fake<IRConConnection>())
|
||||
.AddSingleton(A.Fake<ITranslationLookup>())
|
||||
.AddSingleton(A.Fake<IRConParser>())
|
||||
.AddSingleton(A.Fake<IParserRegexFactory>())
|
||||
.AddSingleton(A.Fake<ClientService>());
|
||||
|
||||
serviceCollection.AddSingleton(_sp => new IW4MServer(_sp.GetRequiredService<IManager>(), ConfigurationGenerators.CreateServerConfiguration(),
|
||||
_sp.GetRequiredService<ITranslationLookup>(), _sp.GetRequiredService<IRConConnectionFactory>())
|
||||
{
|
||||
RconParser = _sp.GetRequiredService<IRConParser>()
|
||||
});
|
||||
|
||||
return serviceCollection;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user