mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -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:
43
Tests/ApplicationTests/VcrTests.cs
Normal file
43
Tests/ApplicationTests/VcrTests.cs
Normal file
@ -0,0 +1,43 @@
|
||||
using ApplicationTests.Fixtures;
|
||||
using IW4MAdmin;
|
||||
using IW4MAdmin.Application;
|
||||
using IW4MAdmin.Application.Misc;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ApplicationTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class VcrTests
|
||||
{
|
||||
private IServiceProvider serviceProvider;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
serviceProvider = new ServiceCollection().BuildBase()
|
||||
.BuildServiceProvider();
|
||||
}
|
||||
|
||||
[Test]
|
||||
[TestCase("replay")]
|
||||
public async Task ReplayEvents(string source)
|
||||
{
|
||||
var sourceData = await serviceProvider
|
||||
.GetRequiredService<DataFileLoader>()
|
||||
.Load<EventLog>(source);
|
||||
|
||||
var server = serviceProvider.GetRequiredService<IW4MServer>();
|
||||
|
||||
foreach (var gameEvent in sourceData.Values.First())
|
||||
{
|
||||
await server.ExecuteEvent(gameEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user