IW4M-Admin/Tests/ApplicationTests/Fixtures/ClientGenerators.cs
RaidMax 5529858edd [misc bug fixes]
properly hide broadcast failure messages if ignore connection lost is turned on
fix concurent issue for update stats history that happened with new event processing
make get/set additional property thread safe
add ellipse to truncated chat messages on home
2020-04-25 19:01:26 -05:00

43 lines
1.4 KiB
C#

using SharedLibraryCore;
using SharedLibraryCore.Database.Models;
using System;
using System.Collections.Generic;
using System.Text;
namespace ApplicationTests.Fixtures
{
public class ClientGenerators
{
public static EFClient CreateBasicClient(Server currentServer, bool isIngame = true, bool hasIp = true, EFClient.ClientState clientState = EFClient.ClientState.Connected) => new EFClient()
{
ClientId = 1,
CurrentAlias = new EFAlias()
{
Name = "BasicClient",
IPAddress = hasIp ? "127.0.0.1".ConvertToIP() : null,
},
Level = EFClient.Permission.User,
ClientNumber = isIngame ? 0 : -1,
CurrentServer = currentServer
};
public static EFClient CreateDatabaseClient(bool hasIp = true) => new EFClient()
{
ClientId = 1,
ClientNumber = -1,
AliasLinkId = 1,
Level = EFClient.Permission.User,
Connections = 1,
FirstConnection = DateTime.UtcNow.AddDays(-1),
LastConnection = DateTime.UtcNow.AddMinutes(-5),
NetworkId = 1,
TotalConnectionTime = 100,
CurrentAlias = new EFAlias()
{
Name = "BasicDatabaseClient",
IPAddress = hasIp ? "127.0.0.1".ConvertToIP() : null,
},
};
}
}