2020-05-22 21:29:41 -04:00
|
|
|
|
using IW4MAdmin.Plugins.Stats.Models;
|
|
|
|
|
using SharedLibraryCore.Database.Models;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace ApplicationTests.Fixtures
|
|
|
|
|
{
|
|
|
|
|
public class MessageGenerators
|
|
|
|
|
{
|
|
|
|
|
public static EFClientMessage GenerateMessage(string content = null, DateTime? sent = null)
|
|
|
|
|
{
|
|
|
|
|
if (!sent.HasValue)
|
|
|
|
|
{
|
|
|
|
|
sent = DateTime.Now;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var rand = new Random();
|
|
|
|
|
string endPoint = $"127.0.0.1:{rand.Next(1000, short.MaxValue)}";
|
|
|
|
|
|
|
|
|
|
return new EFClientMessage()
|
|
|
|
|
{
|
|
|
|
|
Active = true,
|
2020-08-20 11:38:11 -04:00
|
|
|
|
Message = content ?? "test",
|
2020-05-22 21:29:41 -04:00
|
|
|
|
TimeSent = sent.Value,
|
|
|
|
|
Client = new EFClient()
|
|
|
|
|
{
|
|
|
|
|
NetworkId = -1,
|
|
|
|
|
CurrentAlias = new EFAlias()
|
|
|
|
|
{
|
|
|
|
|
Name = "test"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
Server = new EFServer()
|
|
|
|
|
{
|
|
|
|
|
EndPoint = endPoint,
|
|
|
|
|
ServerId = long.Parse(endPoint.Replace(".", "").Replace(":", ""))
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|