mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 07:13:58 -05:00
[tweaks and fixes]
reenable tekno support address vagrant thread issue refactor game log reader creation to follow better practices fix bot issues/address how guids are generated for bots/none provided
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
using FakeItEasy;
|
||||
using IW4MAdmin;
|
||||
using IW4MAdmin.Application.IO;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using NUnit.Framework;
|
||||
using SharedLibraryCore;
|
||||
using SharedLibraryCore.Interfaces;
|
||||
@ -12,11 +14,24 @@ namespace ApplicationTests
|
||||
public class IOTests
|
||||
{
|
||||
|
||||
private IServiceProvider serviceProvider;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
serviceProvider = new ServiceCollection().BuildBase().BuildServiceProvider();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task GameLogEventDetection_WorksAfterFileSizeReset()
|
||||
{
|
||||
var reader = A.Fake<IGameLogReader>();
|
||||
var detect = new GameLogEventDetection(null, "", A.Fake<Uri>(), reader);
|
||||
var factory = A.Fake<IGameLogReaderFactory>();
|
||||
|
||||
A.CallTo(() => factory.CreateGameLogReader(A<Uri[]>.Ignored, A<IEventParser>.Ignored))
|
||||
.Returns(reader);
|
||||
|
||||
var detect = new GameLogEventDetection(serviceProvider.GetService<IW4MServer>(), new Uri[] { new Uri("C:\\test.log") }, factory);
|
||||
|
||||
A.CallTo(() => reader.Length)
|
||||
.Returns(100)
|
||||
@ -35,7 +50,7 @@ namespace ApplicationTests
|
||||
await detect.UpdateLogEvents();
|
||||
}
|
||||
|
||||
A.CallTo(() => reader.ReadEventsFromLog(A<Server>.Ignored, A<long>.Ignored, A<long>.Ignored))
|
||||
A.CallTo(() => reader.ReadEventsFromLog(A<long>.Ignored, A<long>.Ignored))
|
||||
.MustHaveHappenedTwiceExactly();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user