778e339a61
implement filterable meta for issue #158 update translations and use humanizer lib with datetime/timespan for issue #80
29 lines
944 B
C#
29 lines
944 B
C#
using SharedLibraryCore.Database.Models;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace ApplicationTests.Fixtures
|
|
{
|
|
class PenaltyGenerators
|
|
{
|
|
public static EFPenalty Create(EFPenalty.PenaltyType type = EFPenalty.PenaltyType.Ban, EFClient originClient = null, EFClient targetClient = null, DateTime? occurs = null, string reason = null)
|
|
{
|
|
originClient ??= ClientGenerators.CreateDatabaseClient(clientId: 1);
|
|
targetClient ??= ClientGenerators.CreateDatabaseClient(clientId: 2);
|
|
occurs ??= DateTime.UtcNow;
|
|
reason ??= "test";
|
|
|
|
return new EFPenalty()
|
|
{
|
|
Offender = targetClient,
|
|
Punisher = originClient,
|
|
When = occurs.Value,
|
|
Offense = reason,
|
|
Type = type,
|
|
LinkId = targetClient.AliasLinkId
|
|
};
|
|
}
|
|
}
|
|
}
|