mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 07:13:58 -05:00
fix for runaway regular expression on linux
explicitly set string dvars in quotes to allow setting empty dvars allow piping in input from command line (#114) update the distribution for top stats elo prevent game log file rotation from stopping event parsing
This commit is contained in:
42
Tests/ApplicationTests/IOTests.cs
Normal file
42
Tests/ApplicationTests/IOTests.cs
Normal file
@ -0,0 +1,42 @@
|
||||
using FakeItEasy;
|
||||
using IW4MAdmin.Application.IO;
|
||||
using NUnit.Framework;
|
||||
using SharedLibraryCore;
|
||||
using SharedLibraryCore.Interfaces;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ApplicationTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class IOTests
|
||||
{
|
||||
|
||||
[Test]
|
||||
public async Task GameLogEventDetection_WorksAfterFileSizeReset()
|
||||
{
|
||||
var reader = A.Fake<IGameLogReader>();
|
||||
var detect = new GameLogEventDetection(null, "", A.Fake<Uri>(), reader);
|
||||
|
||||
A.CallTo(() => reader.Length)
|
||||
.Returns(100)
|
||||
.Once()
|
||||
.Then
|
||||
.Returns(200)
|
||||
.Once()
|
||||
.Then
|
||||
.Returns(10)
|
||||
.Once()
|
||||
.Then
|
||||
.Returns(100);
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
await detect.UpdateLogEvents();
|
||||
}
|
||||
|
||||
A.CallTo(() => reader.ReadEventsFromLog(A<Server>.Ignored, A<long>.Ignored, A<long>.Ignored))
|
||||
.MustHaveHappenedTwiceExactly();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user