IW4M-Admin/Tests/ApplicationTests/Fixtures/ClientGenerators.cs
RaidMax 778e339a61 QOL updates for profile meta
implement filterable meta for issue #158
update translations and use humanizer lib with datetime/timespan for issue #80
2020-08-18 16:35:21 -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, int clientId = 1) => new EFClient()
{
ClientId = clientId,
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,
},
};
}
}