mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 23:31:13 -05:00
think I finished reworking the event system
added http log reading support for debugging remotely started working on unit test framework
This commit is contained in:
61
Plugins/Tests/ManagerFixture.cs
Normal file
61
Plugins/Tests/ManagerFixture.cs
Normal file
@ -0,0 +1,61 @@
|
||||
using IW4MAdmin.Application;
|
||||
using SharedLibraryCore.Configuration;
|
||||
using SharedLibraryCore.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Xunit;
|
||||
|
||||
namespace Tests
|
||||
{
|
||||
public class ManagerFixture : IDisposable
|
||||
{
|
||||
public ApplicationManager Manager { get; private set; }
|
||||
|
||||
public ManagerFixture()
|
||||
{
|
||||
|
||||
File.WriteAllText("test_mp.log", "TEST_LOG_FILE");
|
||||
|
||||
Manager = Program.ServerManager;
|
||||
|
||||
var config = new ApplicationConfiguration
|
||||
{
|
||||
Servers = new List<ServerConfiguration>()
|
||||
{
|
||||
new ServerConfiguration()
|
||||
{
|
||||
AutoMessages = new List<string>(),
|
||||
IPAddress = "127.0.0.1",
|
||||
Password = "test",
|
||||
Port = 28963,
|
||||
Rules = new List<string>(),
|
||||
ManualLogPath = "https://raidmax.org/IW4MAdmin/getlog.php"
|
||||
}
|
||||
},
|
||||
AutoMessages = new List<string>(),
|
||||
GlobalRules = new List<string>(),
|
||||
Maps = new List<MapConfiguration>(),
|
||||
RConPollRate = 10000
|
||||
};
|
||||
Manager.ConfigHandler = new BaseConfigurationHandler<ApplicationConfiguration>("Test.json");
|
||||
Manager.ConfigHandler.Set(config);
|
||||
|
||||
Manager.Init().Wait();
|
||||
Task.Run(() => Manager.Start());
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Manager.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
[CollectionDefinition("ManagerCollection")]
|
||||
public class ManagerCollection : ICollectionFixture<ManagerFixture>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user