2020-04-21 18:34:00 -04:00
|
|
|
|
using SharedLibraryCore;
|
|
|
|
|
using SharedLibraryCore.Database.Models;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace ApplicationTests.Fixtures
|
|
|
|
|
{
|
|
|
|
|
public class ClientGenerators
|
|
|
|
|
{
|
2020-04-22 19:46:41 -04:00
|
|
|
|
public static EFClient CreateBasicClient(Server currentServer, bool isIngame = true, bool hasIp = true, EFClient.ClientState clientState = EFClient.ClientState.Connected) => new EFClient()
|
2020-04-21 18:34:00 -04:00
|
|
|
|
{
|
|
|
|
|
ClientId = 1,
|
|
|
|
|
CurrentAlias = new EFAlias()
|
|
|
|
|
{
|
|
|
|
|
Name = "BasicClient",
|
2020-04-22 19:46:41 -04:00
|
|
|
|
IPAddress = hasIp ? "127.0.0.1".ConvertToIP() : null,
|
2020-04-21 18:34:00 -04:00
|
|
|
|
},
|
|
|
|
|
Level = EFClient.Permission.User,
|
|
|
|
|
ClientNumber = isIngame ? 0 : -1,
|
|
|
|
|
CurrentServer = currentServer
|
|
|
|
|
};
|
2020-04-22 19:46:41 -04:00
|
|
|
|
|
2020-08-17 22:21:11 -04:00
|
|
|
|
public static EFClient CreateDatabaseClient(bool hasIp = true, int clientId = 1) => new EFClient()
|
2020-04-22 19:46:41 -04:00
|
|
|
|
{
|
2020-08-17 22:21:11 -04:00
|
|
|
|
ClientId = clientId,
|
2020-04-22 19:46:41 -04:00
|
|
|
|
ClientNumber = -1,
|
|
|
|
|
AliasLinkId = 1,
|
|
|
|
|
Level = EFClient.Permission.User,
|
|
|
|
|
Connections = 1,
|
|
|
|
|
FirstConnection = DateTime.UtcNow.AddDays(-1),
|
2020-04-25 20:01:26 -04:00
|
|
|
|
LastConnection = DateTime.UtcNow.AddMinutes(-5),
|
2020-04-22 19:46:41 -04:00
|
|
|
|
NetworkId = 1,
|
|
|
|
|
TotalConnectionTime = 100,
|
|
|
|
|
CurrentAlias = new EFAlias()
|
|
|
|
|
{
|
|
|
|
|
Name = "BasicDatabaseClient",
|
|
|
|
|
IPAddress = hasIp ? "127.0.0.1".ConvertToIP() : null,
|
|
|
|
|
},
|
|
|
|
|
};
|
2020-04-21 18:34:00 -04:00
|
|
|
|
}
|
|
|
|
|
}
|